Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin 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.
Hi,
I currently have in my database a table that looks like this:
We also have another table that provides the descriptive mapping for each generic column name. For example, CUSTOMER_ATTR_1 can be GEOGRAPHY for one customer and it can be COLOR for another customer.
When I display on PowerBI the data from the VALID_CUSTOMER_DATA.CUSTOMER_ATTR_1, I want to display CUSTOMER_INDUSTRY_ID. For CUSTOMER_ATTR_2, I want to display CUSTOMER_SALES_SEGMENT and for CUSTOMER_ATTR_3, I want to display GUIDANCE_GROUP.
Is this dynamic renaming of columns based on a mapping table doable in PowerBI?
Thank you!
-Peter
Solved! Go to Solution.
Hi @tranpeter ,
You can refer the following links to rename column names dynamically:
Dynamically rename columns from a column names table
Table.RenameColumns(
Source,
List.Zip( {fOldColumnNames("TableName"), fNewColumnNames("TableName") } )
)
Using M to dynamically change column names in PowerQuery
Dynamic Column Names in Power Query
Any comment or problem, please feel free to let me know.
Best Regards
A coworker pointed me to this solution. I'll have to give it a try and update this post on whether this worked.
Hi @tranpeter ,
Did you get it worked? If yes, could you please mark the helpful post as Answered? It will help the others in the community find the solution easily if they face the same problem as yours. Thank you.
Best Regards
Hi @tranpeter ,
You can refer the following links to rename column names dynamically:
Dynamically rename columns from a column names table
Table.RenameColumns(
Source,
List.Zip( {fOldColumnNames("TableName"), fNewColumnNames("TableName") } )
)
Using M to dynamically change column names in PowerQuery
Dynamic Column Names in Power Query
Any comment or problem, please feel free to let me know.
Best Regards
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
4 | |
3 | |
3 | |
3 | |
3 |