cancel
Showing results 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.

Anonymous
Not applicable

## Dynamic slicer on measure

Hi,

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

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
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

2 REPLIES 2
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!

Announcements

#### 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

#### Power BI Monthly Update - April 2024

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

#### Fabric Community Update - April 2024

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

Top Solution Authors
Top Kudoed Authors