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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
smpa01
Super User
Super User

Excel.Workbook (Multiple Files and Multiple Worksheets)

I know that Excel.Workbook can be used to tell POWER BI to pickup an excel file/ multiple excel files from a particular folder. For example, there is a folder called POWER BI and it contains a Excel files named A. This file have single workbook Sheet 1 and when I use Excel.Workbook, Power BI nicely brings the data set from the excel file to the the Query Editor. However, I have noticed that if the Excel file A contains multiple worksheets (Sheet 1, Sheet 2, Sheet 3) and the required data set is in Sheet 3, Excel.Workbook always picks up data from Sheet 1 and does not pay attaention to other sheets. Is there a way to specify the sheet name.

 

Also, if I have two excel files A and B in the folder Power BI and Sheet 3 of A and Sheet 1 of B contains the required data set. Can I use Excel.Workbook to bind this two sheets together. I know it works perfectly well if both the files have data in Sheet 1.

 

Thank you in advance.

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs
1 ACCEPTED SOLUTION
v-ljerr-msft
Microsoft Employee
Microsoft Employee

Hi @smpa01,

 

Based on my test, you should be able to use the formula below to specify which sheet you want to import from an excel file. Smiley Happy

 

let
    Source = Excel.Workbook(File.Contents("C:\Power BI\DateFomat.xlsx"), null, true),

//specify which sheet you want to import Sheet2_Sheet = Source{[Item="Sheet2",Kind="Sheet"]}[Data],
#"Promoted Headers" = Table.PromoteHeaders(Sheet2_Sheet, [PromoteAllScalars=true]), #"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"Date2", type date}}) in #"Changed Type"

 

Regards

View solution in original post

1 REPLY 1
v-ljerr-msft
Microsoft Employee
Microsoft Employee

Hi @smpa01,

 

Based on my test, you should be able to use the formula below to specify which sheet you want to import from an excel file. Smiley Happy

 

let
    Source = Excel.Workbook(File.Contents("C:\Power BI\DateFomat.xlsx"), null, true),

//specify which sheet you want to import Sheet2_Sheet = Source{[Item="Sheet2",Kind="Sheet"]}[Data],
#"Promoted Headers" = Table.PromoteHeaders(Sheet2_Sheet, [PromoteAllScalars=true]), #"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"Date2", type date}}) in #"Changed Type"

 

Regards

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.