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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request 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
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 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.

Top Solution Authors