Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
Herson
Regular Visitor

Ticky question regarding Filter/DAX/Slicer

Hi members,

 

I have a table where I need to use slice the Amount by industry/department/group.

However, the tricky part is that when slicing Industry the amount has to be filtered by CATEGORY [CO_101] and [CO_601].

While slicing department, the amount has to be filtered by CATEGORY [CO_301].

When slicing group, the amount has to be filtered by CATEGORY [CO_401].

I wonder how to perform this type of calculation?

The end result I need is to place this measure into a bar chart and people can use slicers to look from different view.

0105 snap shot.png

 

 

PBIX Link: https://drive.google.com/file/d/1yH8zMARc2YZbGv4C-vLJN6cUvmxdViRK/view?usp=sharing

 

Thank you,

Laurence

 

 

1 ACCEPTED SOLUTION
ValtteriN
Community Champion
Community Champion

Hi,

You can create SWITCH measure which changes calculation logic based on slicer selection. Here is an example of the logic:

Measure =
SWITCH(TRUE(),
ISFILTERED(firstslicer),Measure1,
ISFILTERED(secondslicer),Measure2)


I hope this helps and if it does consider accepting this as a solution!




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

2 REPLIES 2
ValtteriN
Community Champion
Community Champion

Hi,

You can create SWITCH measure which changes calculation logic based on slicer selection. Here is an example of the logic:

Measure =
SWITCH(TRUE(),
ISFILTERED(firstslicer),Measure1,
ISFILTERED(secondslicer),Measure2)


I hope this helps and if it does consider accepting this as a solution!




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Thank you ValtteriN for the suggestion!

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Users online (18,634)