Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Dear Community,
I cannot seem to find a simple way to create a filter on two items with an AND condition,.
Take the example dataset below.
How can I easily represent/filter on students that have a qualification in Mathematics and Physics? Thanks in advance for your guidance. Br, Nev
Student Qualification In
A History
A Mathematics
B Spanish
B Physics
B Mathematics
C Mathematics
C Physics
D Physics
E Geography
E Physics
E Mathematics
E History
Solved! Go to Solution.
Hi @nevjohnson,
After research and test, I can get the expected result. When you select both Mathematics and Physics, I create a measure to decide whether the student have choosed both of the class, it will return 1 if he have both of the classes, otherwise, it returns 0. Then put the measure in visual level filter.
Both the qualification or not =
IF (
CALCULATE ( DISTINCTCOUNT ( Table1[Qualification] ), ALLSELECTED ( Table1 ) )
= CALCULATE (
DISTINCTCOUNT ( Table1[Qualification] ),
ALLSELECTED ( Table1[Qualification] )
),
1,
0
)
Please download the .pbix file for more detailed information.
Best Regards,
Angelia
Hi @nevjohnson,
After research and test, I can get the expected result. When you select both Mathematics and Physics, I create a measure to decide whether the student have choosed both of the class, it will return 1 if he have both of the classes, otherwise, it returns 0. Then put the measure in visual level filter.
Both the qualification or not =
IF (
CALCULATE ( DISTINCTCOUNT ( Table1[Qualification] ), ALLSELECTED ( Table1 ) )
= CALCULATE (
DISTINCTCOUNT ( Table1[Qualification] ),
ALLSELECTED ( Table1[Qualification] )
),
1,
0
)
Please download the .pbix file for more detailed information.
Best Regards,
Angelia
User | Count |
---|---|
73 | |
72 | |
39 | |
25 | |
23 |
User | Count |
---|---|
96 | |
93 | |
51 | |
43 | |
42 |