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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
sachti
Frequent Visitor

Power SQL access to filter selection

Hallo,

 

short:

How can i get access to the filter in a parameter definition (Power SQL)?

 

long:

I have a dashboard with a filter.

When i select an item, I want to use the selected value in a stored procedure.

The stored procedure is working well with a given parameter entry.

How can i change the parameter automatically to the selected value?

 

thanks for helping.

 

3 REPLIES 3
v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi @sachti,

 

What is the dashboard filter in your post? If you mean a slicer or page level/report level/visual level filter we added in report body, it is not possible to pass the selected value to stored procedure.

 

If you want to pass a Power BI query parameter value a user specified to stored procedure, then, based on this passed value, fetch data records from databased and load into Power BI, this can be achieved. You can refer to this thread for detailed steps: parameters to SP or Sql query

 

Best Regards,
Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hallo v-yulgu-msft,

 

thank you for your help. The parameter usage is the part already working.

 

= (Rid as text, Id as number) =>
let
    Source= Sql.Database("DATABASENAME", "DATABASENAME2", [Query="EXEC SqlStoredProcedureTable #(lf)@Rid = '" & Rid & "' ,#(lf) @Id  =  " & Number.ToText(Id) & ";"]
in
    Source

 

this is running.

 

The followig Picture describes it better. I want to select a jobrid and with this the stored procedure can return the measurement data for displaying in a graph.

 

Unbenannt.png

 

Thats why i try to get the selected value as parameter for the stored procedure.

But here i use the slicer as drop down menue.

Hi @sachti,

 

As I mentioned in my original post, it is not possible to pass the selected value from slicer to stored procedure. As the available values displayed in a slicer must be fetched and returned by dataset first (in your scenario, use a stored procedure). The logic that using a slicer to filter dataset does not make sense.

 

Best regards,
Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

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.