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

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.

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]

)

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]

)

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors