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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Learner1585
Helper I
Helper I

Import selected multiple sheets from the latest excel file from sharepoint folder wout helper query

Hi,

I am posting first time here in forum.

I am looking for your kind expertise to assist me in my problem below:

 

Problem: Import selected multiple sheets from the latest excel file from sharepoint folder without helper query

 

Background:

  • Multiple excel files ( many sheets in each file) shall be saved in share point folder.
  • I need to pick the latest excel file.
  • From the selected latest file; import 3 selected sheets ( as 3 queries) separately.
    • Sheet names : ( DataSheet4, DataSheet5, DataSheet7)
    • With each query refresh , query should select the latest file and three sheets ( three queries)

      Learner1585_0-1693899838944.png

       

       

      Learner1585_1-1693899838946.png

       

       

       

       

      I know how to import one single file with single sheet only without helper query with the use of custom column.

      I want to be able to do same for my problem mentioned above to select the latest file and import selected multiple sheet separately as three queries( 3sheets) without helper query.

       

      = Table.AddColumn(#"Removed Other Columns", "Custom", each Table.PromoteHeaders(Table.Skip(Excel.Workbook([Content]){0}[Data])))

       


        

       


        

       

       

       

       

8 REPLIES 8
Learner1585
Helper I
Helper I

I dont want to use helpe query coz it eats my query space and make it look dirty.

Also I have felt it slows down the refresh query.

 

Learner1585_0-1693901658598.png

 

Hi @Learner1585 ,

 

I disagree with you, helper query doesn't slow down the refresh and you can always expand or collapse the group using the arrow.

 

But if you still want your requirement, 

After filtering the latest file, instead of clicking the  arrow button beside the content column, Click on the binary instead. 

mussaenda_0-1693902178522.png

 

Then expand the data

mussaenda_1-1693902250302.png

 

This will avoid the helper query that you dont want

 

Hi,

 

Thank you for your suggestion.

 

But this does not seem to be working, I am sorry , I may have not understood exactly what you suggested.

Imported all the files and sorted to see the latest files , deleted all other rows so that now only the latest file is kept.

Learner1585_0-1693907382252.png

 

 

 

 

Clicked on binary which shows all the sheets in the file.

 

 

 

 

Filtered only the desired sheet ( DataSheet4, DataSheet6 ,DataSheet7)

 

Learner1585_2-1693907382258.png

 

 

Clicked on expand Table option which resulted in all the three sheets combined as one query one sheet which is not the desired outcome.

 

 

Hi @Learner1585 ,

 

Before expanding duplicate this twice and filter only by the sheet you need

then expand.

 

That would work, right?

Hi,

 

Thank you.

 

This seems to be a nice work around.

 

Is there any better cleaner way to do this like we do by adding a custom column when its a single sheet file.

 

= Table.AddColumn(#"Removed Other Columns", "Custom", each Table.PromoteHeaders(Table.Skip(Excel.Workbook([Content]){0}[Data])))

Ideally This is what mentioned below I want to achieve with the latest file in shared folder.

 

 

This is when I use the option of web import and map the power query to pick only one file.

All the sheet names are visible and I can multi select my desired files.

 

Learner1585_0-1693907573045.png

 

This results in multiple queries created for each of the imported sheet.

 

Learner1585_1-1693907573047.png

 

 

I want same thing to be happening but with the latest files and without helper query

Learner1585
Helper I
Helper I

Hi,

Thank you for replying.

Below code demonstrate it:

Basically, I direct to share point folder, sort the file by file name ( file name is kept with date sequence)

Then keep the first row ( i.e the top file) and this is my latest file

 

let
Source = SharePoint.Files(https://my.sharepoint.com/sites/salestest/, [ApiVersion = 15]),
#"Filtered Rows" = Table.SelectRows(Source, each [Folder Path] = https://my.sharepoint.com/sites/salestest/Shared Documents/Power Planning),
#"Sorted Rows" = Table.Sort(#"Filtered Rows",{{"Name", Order.Descending}}),
#"Removed Other Columns" = Table.SelectColumns(#"Sorted Rows",{"Content", "Name"}),
#"Kept First Rows" = Table.FirstN(#"Removed Other Columns",1),
Content = #"Kept First Rows"{0}[Content],

mussaenda
Super User
Super User

Hi @Learner1585 

 

How do you define the latest file?

You can do it without the helper query buuut why you don't want to use the helper query?

 

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors