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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Jeanxyz
Power Participant
Power Participant

how to get year data from file name

Hi,

My source file is an Excel stored on sharepoint, the last four digit of the file name (xxxxx_05.08.2021.xlsx) is the year number. I have loaded the data to power query, I want to add a year column in the table, which should use the year data stored in the Excel file name. Is there a way to do this in power query?

1 ACCEPTED SOLUTION
PC2790
Community Champion
Community Champion

In Power Query, you can go to Transform -->Extract --> Text Between Delimiters and configure it like this:

PC2790_0-1628256517633.png

Make sure to duplicate your column to retain the file name as well

View solution in original post

2 REPLIES 2
sevenhills
Super User
Super User

@PC2790 's solution is correct.

In case, you need more details, check this link... 

https://www.myonlinetraininghub.com/import-multiple-files-containing-multiple-sheets-with-power-quer...

 

 

PC2790
Community Champion
Community Champion

In Power Query, you can go to Transform -->Extract --> Text Between Delimiters and configure it like this:

PC2790_0-1628256517633.png

Make sure to duplicate your column to retain the file name as well

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.

Top Solution Authors