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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register 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
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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