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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Anonymous
Not applicable

Get filename column back

in the process of setting up my template file, i believe i accidently deleted the column that had the filename of the dataset (excel) that im building it on.  Is there a way to 1.) add a column with the filename, which will be one?  it would simply populate each row since it is coming from 1 file anyway?  ive been struggling with this for awhile and do not want to have to start from scratch.  i simply want the filename so that i can create a measure for it in a label.

 

can someone tell me how to do this?  have seen several post but none seem to simply be able to do this..... just the filename and it could be the same for every row.

3 REPLIES 3
Anonymous
Not applicable

i do have this also..... i have a query called File Location.  It list the current value - "https://test.sharepoint.com/sites/sharepoint/Manpower%20Reports/TEST.xlsx%22"

i think i am close...... i just need to get the "TEST" part.  the blue part is the TESTname of the file.

cnorris3570_0-1647280989319.png

 

Anonymous
Not applicable

hi sir and thank you for your response.  
1.) i created a query that its current value is "https://TEST.sharepoint.com/sites/sharepoint/Manpower%20Reports"
so when i open my template, it asked me for a File Location dialog box.  I paste in the location like this:  
"https://TEST.sharepoint.com/sites/sharepoint/Manpower%20Reports/TEST.xlsx"
it then loads up the file as it should.  I just need to get label at the top left to display the File name minus the .xlsx

cnorris3570_0-1647273914534.png



hope this helps....

lbendlin
Super User
Super User

There is nothing simple about this (unless you are willing to start over).

 

What connector are you using, the Folder connector, or the Excel connector?  Can you post a sanitized version of your Power Query code?

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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