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! Learn more

Reply
Ganesh31
Frequent Visitor

How change source from SQL (Direct Query) to Excel of a power bi Report

Hi Experts,

I created a power bi report with sql as a source (direct Query) in which advance editor code is shown as below:

 

let
Source = Sql.Databases("SCPHYDWLP00"),
Plant = Source{[Name="Plant"]}[Data],
dbo_PET = Plant{[Schema="dbo",Item="PET"]}[Data]
in
dbo_PET

 

now i want to change the source to excel which is in my One drive,

Path  : "C:\Users\XXXX\OneDrive - XXXXXX\Plant Operations\PLANT OPERATIONS 2 (EXCEL X FORM) .xlsx"

 

Please suggest me the way to modify advance editor code such that Power bi report source should change from sql to excel.

 

Thanks

1 REPLY 1
amitchandak
Super User
Super User

@Ganesh31 , you have to do the reverse of what has been done here, but the steps are the same.

Change Connection from One source type to another Source Type: https://youtu.be/nwYJgG2hmd0

 

Mode need to changed to import

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

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