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
Anonymous
Not applicable

Change SQL command in dashboard

Dear Com,

i could use your help.

I've built a tool to calculate, analyze and visualize time needed for several tasks.

A SQL database is serving as a source for data. Simplified it looks like this:

TaskTimeStamp
Start_Task1dd.mm.yyyy hh:mm:ss
End_Task1dd.mm.yyyy hh:mm:ss
Start_Task2dd.mm.yyyy hh:mm:ss
......

I dont want to load the whole database into PBI, so i plan to use an SQL command to define the time range for my TimeStamps, which are then loaded into PBI.

Is there a way to manipulate this sql command in my dashboard/visualization area?

 

The goal is to set the time range for the queried data from my sql database in the dashboard/visualization are.

So that my colleagues dont have to change the sql command in the query editor.

 

Thank you for your help!


Kind regards

Philipp

1 ACCEPTED SOLUTION
V-lianl-msft
Community Support
Community Support

Hello @PhilippS29 ,

You cannot operate directly on the dashboard, but you can get data through parameter input in the query editor.

https://community.powerbi.com/t5/Desktop/How-do-I-pass-parameters-to-my-SQL-statement/td-p/118716

https://community.powerbi.com/t5/Desktop/Power-BI-parameter-for-SQL-Query/td-p/502628

If you want to get data through the dashboard, we recommend that you use direct query mode instead of import mode.

In direct query mode, when you interact with the dashboard, you will send query statements to the database in real time and return data, but there are some limitations in this mode.

https://docs.microsoft.com/en-us/power-bi/connect-data/desktop-use-directquery#limitations-of-direct...

Best regards
Liang
If this post helps, then consider Accept it as the solution to help other members find it faster.

View solution in original post

1 REPLY 1
V-lianl-msft
Community Support
Community Support

Hello @PhilippS29 ,

You cannot operate directly on the dashboard, but you can get data through parameter input in the query editor.

https://community.powerbi.com/t5/Desktop/How-do-I-pass-parameters-to-my-SQL-statement/td-p/118716

https://community.powerbi.com/t5/Desktop/Power-BI-parameter-for-SQL-Query/td-p/502628

If you want to get data through the dashboard, we recommend that you use direct query mode instead of import mode.

In direct query mode, when you interact with the dashboard, you will send query statements to the database in real time and return data, but there are some limitations in this mode.

https://docs.microsoft.com/en-us/power-bi/connect-data/desktop-use-directquery#limitations-of-direct...

Best regards
Liang
If this post helps, then consider Accept it as the solution to help other members find it faster.

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.