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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

Dynamic slicer on measure

Hi,

 

I found a great video on youtube how to use a measure on a slicer.

https://www.youtube.com/watch?app=desktop&v=8Nt6sHJE_RE

 

It's working fine and really simple to set up, but anyone an idea how you would need to change that to filter on a Value from - Value to?

Now it's always value <= selectedvalue, but I would like to have   Min(selectedvalue) >= value <= Max(selectedvalue)

 

Thx,

Susan

1 ACCEPTED SOLUTION
selimovd
Super User
Super User

Hey @Anonymous ,

 

as you need two values from the slicer (min and max), you have to use ALLSELECTED and then get the min and max.

Try the following approach:

Sales Between = 
VAR vSelected = ALLSELECTED(Slicer[MySlicer])
VAR vMin = CALCULATE(MIN(Slicer[MySlicer]), vSelected)
VAR vMax = CALCULATE(MAX(Slicer[MySlicer]), vSelected)
VAR vCurrentSales = SUM(FactTable[Values])
RETURN
    SWITCH(
        TRUE(),
        vCurrentSales > vMin && vCurrentSales <= vMax, vCurrentSales,
        BLANK()
    )

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
 
Best regards
Denis
 

View solution in original post

2 REPLIES 2
selimovd
Super User
Super User

Hey @Anonymous ,

 

as you need two values from the slicer (min and max), you have to use ALLSELECTED and then get the min and max.

Try the following approach:

Sales Between = 
VAR vSelected = ALLSELECTED(Slicer[MySlicer])
VAR vMin = CALCULATE(MIN(Slicer[MySlicer]), vSelected)
VAR vMax = CALCULATE(MAX(Slicer[MySlicer]), vSelected)
VAR vCurrentSales = SUM(FactTable[Values])
RETURN
    SWITCH(
        TRUE(),
        vCurrentSales > vMin && vCurrentSales <= vMax, vCurrentSales,
        BLANK()
    )

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
 
Best regards
Denis
 
Anonymous
Not applicable

great THX!

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors