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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
cmazur71
New Member

How to use the value of a slider selection in a measure

I have a measure that uses the following formula:

TotalMoved =
CALCULATE(SUM('Volumes'[Dirt]),'Volumes'[Date]="FilterA")
 
The filter value of "FilterA" is selected from a slicer....other options are FilterB, FilterC, etc
I want to replace the "FilterA" in my measure with whatever value the user chooses in the slicer.  Is there a way to use the slicer selection in my measure, rather than hard-coding in a filter?
 
1 ACCEPTED SOLUTION
Shravan133
Super User
Super User

Try This: 

TotalMoved =
CALCULATE(
SUM('Volumes'[Dirt]),
'Volumes'[Date] = SELECTEDVALUE('FilterTable'[FilterColumn])
)

 

  1. SELECTEDVALUE('FilterTable'[FilterColumn]): This function retrieves the value selected from the slicer. You need to replace 'FilterTable'[FilterColumn] with the table and column where the filter values (e.g., FilterA, FilterB, FilterC) are stored. The slicer should be linked to this table and column.

  2. Dynamic Filtering: The slicer will update the measure based on the user’s selection, ensuring that 'Volumes'[Date] is dynamically filtered by the value chosen in the slicer (e.g., "FilterA", "FilterB", etc.).

 

  • Make sure the slicer is connected to the column ('FilterTable'[FilterColumn]) from which the filter values are pulled.
  • If no value is selected in the slicer, SELECTEDVALUE will return BLANK. You can handle this case by providing a default value or using ISBLANK() to add logic for what should happen when nothing is selected.

View solution in original post

2 REPLIES 2
cmazur71
New Member

How do you set the default value for the slicer?

Shravan133
Super User
Super User

Try This: 

TotalMoved =
CALCULATE(
SUM('Volumes'[Dirt]),
'Volumes'[Date] = SELECTEDVALUE('FilterTable'[FilterColumn])
)

 

  1. SELECTEDVALUE('FilterTable'[FilterColumn]): This function retrieves the value selected from the slicer. You need to replace 'FilterTable'[FilterColumn] with the table and column where the filter values (e.g., FilterA, FilterB, FilterC) are stored. The slicer should be linked to this table and column.

  2. Dynamic Filtering: The slicer will update the measure based on the user’s selection, ensuring that 'Volumes'[Date] is dynamically filtered by the value chosen in the slicer (e.g., "FilterA", "FilterB", etc.).

 

  • Make sure the slicer is connected to the column ('FilterTable'[FilterColumn]) from which the filter values are pulled.
  • If no value is selected in the slicer, SELECTEDVALUE will return BLANK. You can handle this case by providing a default value or using ISBLANK() to add logic for what should happen when nothing is selected.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.