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
alicemntt
Frequent Visitor

Update SQL query from a changing data in the dashboard

Hello all, 

 

I'd like to change my SQL query in function of a data that I would change directly in the dashboard. It seems impossible but i'm still trying, hoping someone knows how to do it. 

Here is a bit more details : 
I have an SQL query that imports my data from a data base : 

 

 

 

= Sql.Database("database", "DB", [Query="WITH    TABLESELECT   #(lf)  AS (select [$Table1].[firstdata] [...] #(lf)        where [$Table1].[Date on which the record was created] = CHOSEN_DATE #(lf))#(lf)SELECT * FROM DB    #(lf)#(lf)"])

 

 

 

 

So the date of the imported datas will depend on the 'CHOSEN_DATE'. I know how to change this chosen date in function of a parameter. However, what I'd like to do is to be able to change it from within the dasboard. So i'd like to change the date in the green rectangle and so it updates my native query 

 

Capture d’écran 2022-03-09 à 11.35.03.png

 

Is this possible ? If yes, how ? thank you 

4 REPLIES 4
amitchandak
Super User
Super User

@alicemntt , not very clear. But this direct query, refer Dynamic M 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

Basically I import my datas from an SQL database so i prefilter my datas according to a specific date: 

 

alicemntt_0-1646832238548.png

 

 

So my datas are already prefiltered on the date. However, I'd like to make this filter dynamic and be able to change the date according to whats in the dashboard. So if someone changes the date in the dashboard in the green rectangle in the next screenshot and enter for example march 9th, I'd like the query to be filtered on the 9th of march. Is there any way this is possible ? 

 

alicemntt_1-1646832238556.png

 

 


thank you ! 

Hi @alicemntt ,

I doubt if this is possible. Changing of parameter in the Report Viewer Screen is way downstream from the place where you import the data. The Data selection that you make here will be available only for any downstream operations that you might do like adding a new column or new measure to the original dataset.

 

You can instead use Parameters inside Power Query to do the filtering and display the parameters as read only values in Data Card.

 

For the Users to be able to edit the parameter, you can use the approach that is used in the below video by Guy in a Cube

https://guyinacube.com/2017/05/24/dynamic-power-bi-reports-using-parameters/

 

Regards,

 

Thank you for your response ! I did use the parameters even though it was not an ideal solution ... In the end I actually didn't need to change the date anymore so 🤷🏼‍♀️

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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
Top Kudoed Authors