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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Pass a value using Dax (ex. SelectedValue() )into parameter used in SQL Server Query

Hi, using DAX can you pass the selected value from a slicer, into a parameter that's used in a SQL Server query, so that a set of new data is generated from the value the user passes in?

the user selects a value from a slicer, and i want that slicer to pass that selectedvalue into a parameter that used in SQL Server
The SQL Serve query is basically the following

Select * from table where field = Parameter

3 REPLIES 3
Anonymous
Not applicable

I do have the parameter embedded in the query.
here's part of the query I'm using. PageURL is a single text parameter 

WHERE #(lf) Date >= @@MinDate#(lf) AND #(lf) PageUrl = '" & URL & "' GROUP BY Date, PageUrl)#(lf)Select * from ScrollDepth

now the user can choose off a slicer that has a list of PageURL. How do I get the selected value of the user over to
the parameter?

That's the challenge I have!

@Anonymous check the video which I sahred, that might help.

Did I answer your question? Mark my post as a solution!

Mkarwa-123
Resolver II
Resolver II

@Anonymous this cant be done using selectedvalue(). You have to use parameter in query editor to acomplish this.
https://www.youtube.com/watch?v=7XR6vhdqLCw

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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