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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply

Use if parameters in query

Is it possible, and how, write in query sql 

SELECT ....

CASE
WHEN @Visualizzazione ='D' THEN Sa
ELSE ''
END Sala

FROM ...

Thanks

1 ACCEPTED SOLUTION

Hi @RiccardoBefore ,

 

Do you want to use the 'what if' parameter in the sql query?

It's impossible to achieve the idea in current version(2.83.5894.281 64-bit (July 2020)).

But you can use 'query' parameter to create dynamic data sources.

Dynamic Data Masking and Query Parameters 

 

Best regards,
Lionel Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@RiccardoBefore , do you mean source query.

In advance option you can query of choice

AdvanceProperty.png

 

Also, refer :

https://community.powerbi.com/t5/Desktop/parameterize-connection/m-p/205900#M90712

https://www.biinsight.com/power-bi-desktop-query-parameters-part-1/

https://radacad.com/change-the-source-of-power-bi-datasets-dynamically-using-power-query-parameters

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

Thank you, @amitchandak .

I would have preferred a solution similar to that of Reporting Services.

This use of parameters is not usable by customers. 

 

Thanks.

Riccardo

Hi @RiccardoBefore ,

 

Do you want to use the 'what if' parameter in the sql query?

It's impossible to achieve the idea in current version(2.83.5894.281 64-bit (July 2020)).

But you can use 'query' parameter to create dynamic data sources.

Dynamic Data Masking and Query Parameters 

 

Best regards,
Lionel Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.