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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
Anonymous
Not applicable

Change "Direct Query to AS" to SQL import

Hi,

 

When I download file from PowerBI Service I lost my Power Queries

Wuyo269_0-1699359564815.png

This is how it looks before

Wuyo269_1-1699359669964.png

I have a lot of transformation there and I would like to restore them

Wuyo269_2-1699359698183.png

I can see on "Data source settings" that there is a connection to "DirectQuery to AS"

Wuyo269_3-1699359721511.png

 

Before I had conection directly to SQL database

Wuyo269_4-1699359771767.png

 

 

Do you know how can I restore the connection and power queries?

 

Thank you in advace

 

 

 

5 REPLIES 5
ShirinArshadnia
Helper II
Helper II

@Anonymous 

please share your example.

ShirinArshadnia
Helper II
Helper II

hi @Anonymous 

when you change your data source you can see the queries and all the steps in that source,you should use the left panel to navigate from sources and queries.

 

Anonymous
Not applicable

Hi @ShirinArshadnia 

 

I know this.

My question is how to do it 🙂

 

Thank you

Anonymous
Not applicable

Hi @Anonymous ,

Thank you for reaching out to us with your problem. It seems like you’re trying to restore Power Queries and restore the data source from “DirectQuery to AS” to a direct SQL database connection in Power BI. And they are different data source type. If the data from these two data sources have the same data structure, you can follow the below steps to get it:

1. Open the Power BI file: Open the Power BI file where you want to restore the Power Queries.

2. Go to Query Editor: In the Home tab, click on ‘Edit Queries’ to open the Power Query Editor.

3. Change Data Source: In the Power Query Editor, you can change the data source from SQL database to “DirectQuery to AS”. To do this, go to ‘Home’ > ‘Data Source Settings’. In the window that opens, you can change the data source.

How to Change Data Sources for Existing Power BI Reports - Iteration Insights

How to Change Data Source in Power BI - Zebra BI

vyiruanmsft_0-1699514824294.png

4. Restore Power Queries: If you have a backup of your Power Queries, you can restore them in the Power Query Editor. Go to ‘Home’ > ‘Advanced Editor’, and replace the existing M code with your backup M code.

Advanced Editor

vyiruanmsft_1-1699515101952.png

Best Regards

Anonymous
Not applicable

Hi,

 

Thank you for your reposne

Unfortuneately id did not help me.

 

I changed the data source but it did not restore my tables. It has created a new one.

 

And I do not have a backup query I want to restore it

 

If you not how to solve it pelase tell me 🙂

 

Thank you in advance

 

 

 

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.