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
TotunG
Resolver I
Resolver I

How to reference a slicer in formula

Measure = VAR SelectedValue = SELECTEDVALUE('Slicer Name')
RETURN
COUNTROWS(FILTER('Table','Table'[Date] = SelectedValue))
 
The above measure isn't working for me. I'm testing to write it into a larger formula but it gives me the error that 'Slicer Name' does not exist as a Table.
 
The slicer name is definitely correct and follows case-sensitive rules.
 
Any ideas on this?
1 ACCEPTED SOLUTION
Mikelytics
Resident Rockstar
Resident Rockstar

Hi @TotunG ,

 

The Syntax for SELECTEDVALUE  is :

 

SELECTEDVALUE(TableName[ColumnName] ) or 

 

SELECTEDVALUE(TableName[ColumnName]Alternative Result ) Alternative Result comes when multiple or no value is selected in column.

 

So you need to put the table and column which you put into the slicer you want to refer to.

 

SELECTEDVALUE-Funktion - DAX | Microsoft Learn

 

Best regards
Michael
-----------------------------------------------------
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Appreciate your thumbs up!
@ me in replies or I'll lose your thread.

------------------------------------------------------------------
Visit my blog datenhungrig which I recently started with content about business intelligence and Power BI in German and English or follow me on LinkedIn!

View solution in original post

2 REPLIES 2
Mikelytics
Resident Rockstar
Resident Rockstar

Hi @TotunG ,

 

The Syntax for SELECTEDVALUE  is :

 

SELECTEDVALUE(TableName[ColumnName] ) or 

 

SELECTEDVALUE(TableName[ColumnName]Alternative Result ) Alternative Result comes when multiple or no value is selected in column.

 

So you need to put the table and column which you put into the slicer you want to refer to.

 

SELECTEDVALUE-Funktion - DAX | Microsoft Learn

 

Best regards
Michael
-----------------------------------------------------
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Appreciate your thumbs up!
@ me in replies or I'll lose your thread.

------------------------------------------------------------------
Visit my blog datenhungrig which I recently started with content about business intelligence and Power BI in German and English or follow me on LinkedIn!

That's a good explanation how the SELECTEDVALUE function works, but it's not the answer to his question: "How to reference a slicer in formula?" 

Hence, the answer to the question would be: "you don't!" or rather you can't directly reference a slicer. BUT!!!

 

You can create an options table containing the slicer's future options. The this new table is linked in a 1:n relationship with the data table you need filtered. The slicer is linked to your newly created options table. This way you can address the options table with selectedvalue AND filter the data table.

Hope that helps 🙂 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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