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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. 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
Solution Sage
Solution Sage

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

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.