Forum Discussion
Power Query Use First Row as Headers for selected (or single) Row(s)
- 1 year ago
I agree. It is amazing how this community works.
I didn't see any of those answers as a solution for my problem. I did it like this:
#"Promoted Headers Conditionally" = Table.TransformColumns(
#"Added Custom",
{
"Data",
each
if List.First(Table.ColumnNames(_)) = "Column1" then
Table.PromoteHeaders(_, [PromoteAllScalars=true])
else
_
}
I agree. It is amazing how this community works.
I didn't see any of those answers as a solution for my problem. I did it like this:
#"Promoted Headers Conditionally" = Table.TransformColumns(
#"Added Custom",
{
"Data",
each
if List.First(Table.ColumnNames(_)) = "Column1" then
Table.PromoteHeaders(_, [PromoteAllScalars=true])
else
_
}
Hi Gandhi,
Thank you for reaching out to the Microsoft fabric community forum.
I would also take a moment to thank rohit1991 , DataVitalizer for actively participating in the community forum and for the solutions you have been sharing in the community forum. Your contributions make a real difference.
your idea to check if the first column is "Column1" and then only promote headers for those tables is perfect, especially when all sheets don't follow the same format. This way, you are not touching the sheets that already have correct headers, and still keeping important columns like "Item" or "Name" for year identification.
This kind of logic works very well when you are combining multiple dynamic sheets like 2023, 2024, 2025, etc, and you don’t want to manually adjust each time.
Hope this helps if you have any queries we are happy to assist you further.
Best Regards,
Harshitha.
- v-hjannapu1 year agoCommunity Support
Hi Gandhi,
I hope the above details help you fix the issue. If you still have any questions or need more help, feel free to reach out. We are always here to support you.
Regards,
Harshitha.- v-hjannapu1 year agoCommunity Support
Hi Gandhi,
I wanted to follow up and see if you have had a chance to review the information that was shared. If you have any additional questions or need further clarification, please don’t hesitate to reach out. I am here to assist with any concerns you might have.
Regards,
Harshitha.