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

multiple conditional slicers

Hello everybody,

 

image.png

have the following simplified scenario,  I would like to be able to select columns (column 1 or column 2) first and then select operations (max or min). The Model and the Data looks as follows:

image.pngimage.pngimage.png

 

image.png

But as soon as I select column1 the operations slicer only shows one option the 'min', although min is not selected the min shows up...

image.png

how could it be realised that max does not disappear ... thx 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

@SteveCampbell  ok thanks for the hint

measure3 = IF(
SELECTEDVALUE(SelectColumn[selection]) = "column 1";
SWITCH(
    TRUE();
    VALUES(SelectOperation[condition 2]) = "min"; MINX(numbers; numbers[Column1]);
    VALUES(SelectOperation[condition 2]) = "max"; MAXX(numbers;numbers[Column1])
)
;IF(
        SELECTEDVALUE(SelectColumn[selection]) = "column 2";
        SWITCH(
            TRUE();
            VALUES(SelectOperation[condition 2]) = "min"; MINX(numbers; numbers[Column2]);
            VALUES(SelectOperation[condition 2]) = "max"; MAXX(numbers;numbers[Column2])
        )
        ))

View solution in original post

4 REPLIES 4
SteveCampbell
Memorable Member
Memorable Member

"SelectColumn" and "SelectValue" are in the same table, so they are filtering each other. Best practice, would to be to put them in two seperate tables.

 

You could add a cartesian join, but this may become more difficult to manage if you add more columns or values (such as average, sum etc).

 

 



Did I answer your question? Mark my post as a solution! Proud to be a Super User!


Connect with me!
Stay up to date on  
Read my blogs on  



Anonymous
Not applicable

@SteveCampbell after putting them in two separate tables. I cannot select the columns from a separate table. I get an error as shown in the picture.

image.png

SelectColumn[selection] refers to a column, so it finds it difficult to compare to one value.

 

Try replacing with:

SELECTEDVALUE( SelectColumn[selection] )


Did I answer your question? Mark my post as a solution! Proud to be a Super User!


Connect with me!
Stay up to date on  
Read my blogs on  



Anonymous
Not applicable

@SteveCampbell  ok thanks for the hint

measure3 = IF(
SELECTEDVALUE(SelectColumn[selection]) = "column 1";
SWITCH(
    TRUE();
    VALUES(SelectOperation[condition 2]) = "min"; MINX(numbers; numbers[Column1]);
    VALUES(SelectOperation[condition 2]) = "max"; MAXX(numbers;numbers[Column1])
)
;IF(
        SELECTEDVALUE(SelectColumn[selection]) = "column 2";
        SWITCH(
            TRUE();
            VALUES(SelectOperation[condition 2]) = "min"; MINX(numbers; numbers[Column2]);
            VALUES(SelectOperation[condition 2]) = "max"; MAXX(numbers;numbers[Column2])
        )
        ))

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.