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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Kees
Helper I
Helper I

Select datafile that changes monthly

Hi,

 

Although I found some some suggestion for my problem I could not find one that suits my need.

 

I have a XLSX datafile that I need in my PBI queries that changes monthly (Always in the same Sharepoint folder).;
 - Billing Cumulative_Raw Data 2023-10 v1.0 2023-10-17

next month this file will be removed and new file will be:

 - Billing Cumulative_Raw Data 2023-11 v1.0 2023-11-17

 

So the first part stays always the same: Billing Cumulative_Raw Data.

 

in the Source of my Query Setting I have now:
let
Source = SharePoint.Contents("https://fakename.sharepoint.com/sites/fakefolder/", [ApiVersion = 15]),
#"Shared Documents" = Source{[Name="Shared Documents"]}[Content],
#"Billing" = #"Shared Documents"{[Name="Billing"]}[Content],
#"Billing Cumulative_EMEA Raw Data 2023-10 v1 0 2023-10-17 xlsx" = #"Billing"{[Name="Billing Cumulative_EMEA Raw Data 2023-10 v1.0 2023-10-17.xlsx"]}[Content],
#"Imported Excel Workbook" = Excel.Workbook(#"Billing Cumulative_EMEA Raw Data 2023-10 v1 0 2023-10-17 xlsx"),


I'm looking for a way to select the datafile starting with: Billing Cumulative_Raw Data.

 

Any suggestions?

 

Brgds Kees

1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

let
Source = SharePoint.Contents("https://fakename.sharepoint.com/sites/fakefolder/", [ApiVersion = 15]),
#"Shared Documents" = Source{[Name="Shared Documents"]}[Content],
#"Filtered Rows" = Table.SelectRows(#"Shared Documents", each Text.StartsWith([Name], "Billing Cumulative"))
#"Imported Excel Workbook" = Excel.Workbook(#"Filtered Rows"{0}[Content]),

 

I'm looking for a way to select the datafile starting with: Billing Cumulative_Raw Data.

Your files don't start with that.  You have the region name in between.

View solution in original post

2 REPLIES 2
lbendlin
Super User
Super User

let
Source = SharePoint.Contents("https://fakename.sharepoint.com/sites/fakefolder/", [ApiVersion = 15]),
#"Shared Documents" = Source{[Name="Shared Documents"]}[Content],
#"Filtered Rows" = Table.SelectRows(#"Shared Documents", each Text.StartsWith([Name], "Billing Cumulative"))
#"Imported Excel Workbook" = Excel.Workbook(#"Filtered Rows"{0}[Content]),

 

I'm looking for a way to select the datafile starting with: Billing Cumulative_Raw Data.

Your files don't start with that.  You have the region name in between.

Got it working!

 

Thanks very much, making my day!

 

Brgds Kees

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

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.