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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! 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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.