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

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.

Reply
Anonymous
Not applicable

switch two columns with two slicers

Hi, recently I have a very complicate problem,

here is the data and relative slicers:

null_0-1660612939371.png

 

 

when I select values from slicer1, sum the value from cal1,

and when I select values from slicer2, sum the value from cal2,

when I select both slicer1 and slicer2, sum the value from cal1.

so how can I create such a calculation get the result value, do you have any good ideas?

Thank you.

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , Isfiltered can help

 

Measure =

var _1 = calculate(isfiltered(Dim1[Col]), allselected())

var _2 = calculate(isfiltered(Dim2[Col]), allselected())

return

Switch(True(),

_1 && _2 , [Cal1] ,//assume cal1 and cal2 are measures

_1 , [Cal1] ,

_2 , [Cal2]

)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@Anonymous , Isfiltered can help

 

Measure =

var _1 = calculate(isfiltered(Dim1[Col]), allselected())

var _2 = calculate(isfiltered(Dim2[Col]), allselected())

return

Switch(True(),

_1 && _2 , [Cal1] ,//assume cal1 and cal2 are measures

_1 , [Cal1] ,

_2 , [Cal2]

)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 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.