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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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