Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
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
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 39 | |
| 37 | |
| 33 | |
| 33 | |
| 29 |
| User | Count |
|---|---|
| 132 | |
| 90 | |
| 78 | |
| 66 | |
| 65 |