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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
naoyixue1
Post Patron
Post Patron

Using first row as a header issue

Hey there, 

 

I tried to create the report to catch the latest 30 days excel file, which is extracted out of the other planning system. Givne that, individual file will have the name about when to extract. It causes the problem to rename the header after I use the first row as a header. Since the header is change (since the file name which is using as a header is keeping refresh), BI cannot handle that situation. (for example, on 9/15/23, my header will be 8/16/23; on 9/16/23, my header will be 8/17/23) (see below) 

 

So just check whether there is any work around, so BI can always rename the header from that file name to one specfic name such as file, etc. Any thoughts? 

naoyixue1_0-1694797103237.png

naoyixue1_1-1694797310728.png

 

1 ACCEPTED SOLUTION
naoyixue1
Post Patron
Post Patron

Hey all, thanks. I just figured it out. In this case, I can use the create the conditional column to avoide that issue. Anyway, thank you though. 

 

naoyixue1_2-1694798749927.png

 

View solution in original post

6 REPLIES 6
parry2k
Super User
Super User

@naoyixue1 you will replace the previous step with the previous step name in your M: from your screenshot it looks like it is promoted headers1, so it will be:

 

 #"Renamed Columns" = Table.RenameColumns(#"Promoted Headers1",{{Table.ColumnNames(#"Promoted Headers1"){0}, "New Column Name"}})

 

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

naoyixue1
Post Patron
Post Patron

Hey all, thanks. I just figured it out. In this case, I can use the create the conditional column to avoide that issue. Anyway, thank you though. 

 

naoyixue1_2-1694798749927.png

 

KEAlexander
Helper I
Helper I

How about deleting the Source.name column first, then promoting headers?  Then if you need some part of the info in the Source.name column, create a new column and populate it with the needed information. 

parry2k
Super User
Super User

@naoyixue1 you can add a step to rename the column dynamically:

 

    #"Renamed Columns" = Table.RenameColumns(<Previous Step>,{{Table.ColumnNames(<Previous Step>){0}, "New Column Name"}})


Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

@parry2k  I'm guessing something is wrong about my M code, would you help to take a look into it? thanks!

 

naoyixue1_0-1694799052905.png

 

naoyixue1
Post Patron
Post Patron

Hey there,

Just found it also causes the error when I try to uppivot the tabe, because that step is based on the header name. Not sure whether there is a workaround or I should totally do the other ways to pull the last 30 days file in one folder.  Anyway, thanks!

naoyixue1_1-1694798220004.png

 

 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

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.