Power BI: Edit Existing SQL Query

how to edit sql query in Power BI

In this post, I’m gonna explain How to Edit Existing SQL Query in Power BI Desktop?

How to Edit Existing SQL Statement in Power BI Desk Top
edit query in power bi

Edit Query in Power BI?

I have created a new Power BI Report using Power BI Desktop with SQL Server Database as a data source.

Power BI: Edit Existing SQL Query

I have provided the below info:

  • SQL Server Instance.
  • Database Name.
  • SQL Statement.
Power BI: Edit Existing SQL Statement
  • I clicked OK, then I started working on the Dashboard.
  • I implemented most of my dashboard requirements but I got new requirements that require editing the provided SQL query to add additional fields without adding a new data source in my model!

How to edit SQL Query in Power BI?

To edit an existing SQL query in Power Query in Power BI, you have to do the following:

Steps

  1. In the Home tab > Click on “Edit Queries” > Select “Edit Queries“.
Edit Queries in Power BI
  1. The “Power Query Editor” would be opened.
  2. On the left side, you can find the “Queries” list.
  3. Click on the query that you need to edit your SQL statement.
Queries in Power Query Editor In Power BI
  1. On the right, you can find the “Query Settings” for the selected query.
  2. Below the “Applies Steps“, Click on the Setting icon gear besides the “Source” to edit the “Query Source“.
Edit the Source in the Query Settings in Power BI
  1. The SQL Server database settings would be shown, you can edit your SQL statement as you prefer.
Power BI: Edit Existing SQL Query
  1. Close & Apply.
Close and apply in power bi

You may also like to read Power BI: Switch from Import to DirectQuery Mode.


Applies To

  • Power BI Report Server.
  • Power BI Service.

Conclusion

In this post, I have explained How to edit SQL Server Database settings in Power BI by editing the source query form the Query settings in Power Query Editor.

Have a look at

1 thought on “Power BI: Edit Existing SQL Query”

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top