Forum Discussion

AlvinLy's avatar
AlvinLy
Icon for Helper II rankHelper II
2 years ago
Solved

Slicing by Measure Categories Multi-Select

Hello,

 

Before i post my full question i want to give a shoutout to BI Elite and this video:

Slicing by Measure Categories in Power BI (youtube.com)

 

Also to this previous similar post that relates to my question:

Solved: How to use a measure as slicer? - Microsoft Fabric Community

 

I want to use a measure as a slicer, but as shown in the previous two sources, this is possible with an additional table but when i've tried a similar method it is restricted to single select. Can we replicate the same but with multi-select?

 

For ones who don't want to go through th previous two sources. I pretty much want to use a measure for a slicer without the limitation of single select. Very similar to the previous Fabric Post, but it seems like the slicer selection is limited to single-select. I can provide a quick sample data below

 

Measure:

 

Late Critera = 
VAR Baseline = SELECTEDVALUE('Table'[Baseline Finish])
VAR Finish = SELECTEDVALUE('Table'[Finish Date])
VAR Variance = Baseline - Finish
RETURN
IF(ISBLANK(Variance), BLANK(),
SWITCH(TRUE, 
    Variance >= 0, "On Schedule",
    Variance < 0 && OriginalVar > -7, "<1 Wk Late",
    Variance <= -7 && OriginalVar > -14, ">1 Wk Late",
    Variance <= -14, ">2 Wk Late",
    BLANK()
))

 

 

ActivityFinish DateBaseline FinishLate Criteria
12024-06-142024-06-18On Schedule
22024-06-142024-06-20On Schedule
32024-06-142024-06-12<1 Wk Late
42024-06-142024-06-04>1 Wk Late
52024-06-142024-06-06>1 Wk Late
62024-06-142024-06-02>1 Wk Late
72024-06-142024-05-12>2 Wk Late

 

And I want to create a slicer that can choose multiple or single select of the four possible outcomes of the measure:

On Schedule
<1 week late

>1 week late

>2 weeks late

 

Thanks,

  • Hi AlvinLy 

     

    You can refer to the post you provided, and only need to make some small change, which is to change the code in step3 to the following, with all other steps being the same.

     

    Solved: How to use a measure as slicer? - Microsoft Fabric Community

     

     

    Measure_filter = 
    
    var x1=VALUES('Status'[Status])
    
    return
    
    IF([Status] IN x1,1,0)

     

     

    Please allow my laziness...

     

     

    Did I answer your question? If yes, pls mark my post as a solution and appreciate your Kudos !

     

    Thank you~

     

1 Reply

  • Hi AlvinLy 

     

    You can refer to the post you provided, and only need to make some small change, which is to change the code in step3 to the following, with all other steps being the same.

     

    Solved: How to use a measure as slicer? - Microsoft Fabric Community

     

     

    Measure_filter = 
    
    var x1=VALUES('Status'[Status])
    
    return
    
    IF([Status] IN x1,1,0)

     

     

    Please allow my laziness...

     

     

    Did I answer your question? If yes, pls mark my post as a solution and appreciate your Kudos !

     

    Thank you~