Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello,
I have two visual level filters for two different levels - for example;
Filter 1 Filter 2
1 11
2 12
3 13
22
23
When you filter on 1 on Filter 1, it will bring back 11, 12, 13 - 2 on Filter 2 will bring back 22, 23 etc
When i have Filter 1 Selected and then Filter 2 selected to bring back data for 22, for example, the data shows data for 2
My code is;
VAR Filter1 = IF ( HASONEVALUE ( 'Filter_Lookup'[Channel] ), VALUES ( 'Filter_Lookup'[Channel] ), BLANK () ) VAR Filter2 = IF ( HASONEVALUE ( 'Filter_Lookup_Team'[Team] ), VALUES ( 'Filter_Lookup_Team'[Team] ), BLANK () ) RETURN SWITCH ( TRUE (), Filter1 = "1", CALCULATE ( SUM ( Target_Output[Value] ), FILTER ( Target_Output, Target_Output[Channel] = "KA" ), FILTER ( Target_Output, Target_Output[Type] = "NSV" ) ), Filter1 = "2", CALCULATE ( SUM ( Target_Output[Value] ), FILTER ( Target_Output, Target_Output[Channel] = "Vape" ), FILTER ( Target_Output, Target_Output[Type] = "NSV" ) ), Filter2 = "22", CALCULATE ( SUM ( Target_Output[Value] ), FILTER ( Target_Output, Target_Output[Channel] = "22" ), FILTER ( Target_Output, Target_Output[Type] = "NSV" ) ), Filter2 = "23", CALCULATE ( SUM ( Target_Output[Value] ), FILTER ( Target_Output, Target_Output[Channel] = "23" ), FILTER ( Target_Output, Target_Output[Type] = "NSV" ) ), BLANK())
Is there a way when i select something from Filter2, the pre selection of Filter1 can be ignored? I have tired ALL(), ALLEXCEPT() etc etc
Many Thanks
Hi @rjg2g11,
Switch function not support to calculate with summarize records or split result based on category. (For your scenario, it will check all cases which you list and return the first matched condition)
In addition, if you can please share some sample data for test.
Regards,
Xiaoxin Sheng
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
112 | |
100 | |
76 | |
74 | |
49 |
User | Count |
---|---|
145 | |
108 | |
107 | |
89 | |
61 |