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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. 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
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

Check out the February 2024 Power BI update to learn about new features.

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors