Forum Discussion

shelbsassy's avatar
shelbsassy
Resolver I
8 years ago
Solved

Need to change SQL in data source

I need to make some changes to the SQL statement I have as a Direct Query using SQL Server in Power BI.  What is the best way to go about doing this without losing all my relationships and connection...
  • Anonymous's avatar
    Anonymous
    8 years ago

    shelbsassy So first, cut a copy of your desktop PBIX file and save it as a seperate file. Use that file to mess around with so you aren't so worried about destroying your report.

    You can easily access the original query by going to edit queries and clicking on the wheel icon next to the "Source" in the Applied Steps pane on the right hand side. This will open the original prompt and you can copy/paste the new code in there.

     

    As long as the new query includes the columns you are already using you shouldn't have any issues with things breaking. You would do this for each query you have, as each would have their own SQL code I assume. (If you have multiple queries and you are worried about relationships breaking)