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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
lmfernandez
Frequent Visitor

Load an excel from sharepoint but the last caracters of name file changes depending of the day

Hello,

 

I have to load to Power Bi  an excel that is located in Sharepoint.

For example, the path is this:
https://example.sharepoint.com/sites/group/Shared Documents/General/PLANIFICACION/T3G_PLA_CdM_Planificacion-1234.xlsx

 

The problem is that the bold font part of the xlsx file name changes with the time.

For example, today this file can name T3G_PLA_CdM_Planificacion-1234.xlsx, but tomorrow it can be T3G_PLA_CdM_Planificacion-8541.xlsx

 

I have tried using the path with regular expression like this but it doesnt work:

https://example.sharepoint.com/sites/group/Shared Documents/General/PLANIFICACION/T3G_PLA_CdM_Planificacion-.*.xlsx

 

I need to say to Power Bi that get the data that begins with T3G_PLA_CdM_Planificacion- ignoring the last caracters.

 

Ignorar.JPG

 

Is there any way to do that?

 

Thank you in advance

Regards

1 ACCEPTED SOLUTION
v-janeyg-msft
Community Support
Community Support

Hi, @lmfernandez 

 

Do you want to get the latest date data based on the file name? If so, you can set parameters in PQ to customize the file name.

Like this:

v-janeyg-msft_0-1622080808741.png

v-janeyg-msft_1-1622080917129.png

After setting, you can manually select the file name you want.

If you still have problems, please feel free to ask me.

 

Best Regards

Janey Guo

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-janeyg-msft
Community Support
Community Support

Hi, @lmfernandez 

 

Do you want to get the latest date data based on the file name? If so, you can set parameters in PQ to customize the file name.

Like this:

v-janeyg-msft_0-1622080808741.png

v-janeyg-msft_1-1622080917129.png

After setting, you can manually select the file name you want.

If you still have problems, please feel free to ask me.

 

Best Regards

Janey Guo

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

mahoneypat
Microsoft Employee
Microsoft Employee

There are a few ways to do that.  Are the files from the previous day still there?  Here are two suggestions:

 

1.  Use a Power Automate flow that is triggered when a new file is created, renaming the new file and then pointing Power BI at the file with that name.

 

2.  You can sort your query off the created date of the file, or you can use the Table.MaxN function to keep the top one in terms of created date.

 

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


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! Prices go up Feb. 11th.

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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