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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
Anonymous
Not applicable

parameters SQL / buttons

Hi

 

i have a sql statement containing paramater.

 

@placed=<3

 

How can I integrate this into PowerBI so a user can select different parameters? I.e. alter the =<3

 

User Screen would like :

 

p4nny_0-1631624283343.png

 

 

When this number (button) is clicked, it would run the sql query (direct query). That would be enterted in the parameters query and return the specific counts. I can do this in Excel but struggling in PowerBI.

 

Appreciate the guidance

 

Thanks

Anthony

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

@Anonymous 
You can create a what if parameter. 

Use what-if parameters to visualize variables - Power BI | Microsoft Docs

 

Then add add the parameter to your measures as an additional filter, for example.

Measure = CALCULATE(SUM([Value]),FILTER(Table,[placed]<=Selectedvalue((Parameter[Parameter]))))
Vpazhenmsft_0-1631846585818.png

 

You can selected any number as the filter conditional.

 

 

Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

@Anonymous 
You can create a what if parameter. 

Use what-if parameters to visualize variables - Power BI | Microsoft Docs

 

Then add add the parameter to your measures as an additional filter, for example.

Measure = CALCULATE(SUM([Value]),FILTER(Table,[placed]<=Selectedvalue((Parameter[Parameter]))))
Vpazhenmsft_0-1631846585818.png

 

You can selected any number as the filter conditional.

 

 

Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@Anonymous , see if Dynamic M paaremeter can help

https://docs.microsoft.com/en-us/power-bi/connect-data/desktop-dynamic-m-query-parameters

 

For button you can use slicer with horizontal orientation

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.