cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Frequent Visitor

## Filter per category

Hi !

I have 2 tables, Table A shows part number applicability , Table B shows stock levels.

I want to create a report that shows P/N and q-ty per selected AC type. I tried (snip below) but i get P/N A listed twice (and double q-ty) because it is linked to 2 AC types.

Any help appreciated! 🙂

 P/N AC type A 737 A 787 B 737 C D 787

 P/N Qty A 10 B 1 C 2 D 54

1 ACCEPTED SOLUTION
Super User

Have updated the demo file. The quanity measure needed to read the p/n currently needed...

``````Quantity =
CALCULATE(
SUM ( Stock[Qty] ),
TREATAS( VALUES(Applicability[P/N]), Stock[P/N] )
)``````

Could have made relationship bidirectional but this is safer.

Ben Dobbs

Did I answer your question? Mark my post as a solution! This will help others on the forum!
11 REPLIES 11
Super User

Can you mock up the output you actually want in excel?

I think the way to go is using CONCATENATEX but want to be sure of the output you need.

Ben Dobbs

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Frequent Visitor

hi bcdobbs

i will create button shape filters for each AC type:

Depending on selected button(s), here is what i expect to see:

for single selections its not a problem, its multiple AC types selected that give wrong total q-ties.

thanks 🙂

Super User

Have a go with this demo: Applicability Demo

Rather than dropping the A/C column into the visual use this measure instead (and use P/N from your stock table):

``````Applicable Types =
VAR Result =
CONCATENATEX(
VALUES(Applicability[AC type]),
Applicability[AC type],
", ",
Applicability[AC type], ASC
)

RETURN IF ( ISINSCOPE(Stock[P/N]), Result, BLANK() )``````

Ben Dobbs

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Super User

Actually I think I'm doing it the opposite way round to what you want! Will update.

Ben Dobbs

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Frequent Visitor

that looks very promising!! not sure if it would be possible for ex. that only selected AC types are shown in the table..  i selected 787 and total q-ty is 67. if non relevant where hidden then it would be perfect

Super User

I think my change to the quanity measure mentioned below does what you need.

Ben Dobbs

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Super User

Have updated the demo file. The quanity measure needed to read the p/n currently needed...

``````Quantity =
CALCULATE(
SUM ( Stock[Qty] ),
TREATAS( VALUES(Applicability[P/N]), Stock[P/N] )
)``````

Could have made relationship bidirectional but this is safer.

Ben Dobbs

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Frequent Visitor

PERFECT!!! thank you so much bcdobbs! you are genious 🙂

Super User

Enjoyed it! Looked simple to start with but there are some subtle requirements! Thanks.

Ben Dobbs

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Super User

I think it's a legitimate use case of a bidirectional relationship. Especially if you only have those two tables. Would remove the need for the TREATAS.

Ben Dobbs

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Frequent Visitor

hi bcdobbs

yes, birectional is the only available i can chose..

i havent used the Quantity measure and it adds up correctly.

The next challenge, how could i filter if i want by A/C type that is unique : ex. 787 only.

so in my initial example, by chosing 787 it would normally show only D; A would be excluded as its both 787 and 737.

I think the easiest to solve this is by using filter "does not include" in applicable types  ? 😊

Rgds

Aris

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

#### Power BI Monthly Update - August 2024

Check out the August 2024 Power BI update to learn about new features.

#### Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

#### Fabric Community Update - September 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors