- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Use Table to Replace Column Headers
Hello. I'm putting some Census data into a report, and the headers on the master data sheet are abbreviations that I'd like to swap out for their understandable titles that are in a seperate table. Due to the size of both lists (and to keep the data modeling clean) I'd like to use the Advance Editor, but I'm not having any luck.
Is it possible to use the Rename Columns coding but instead of a static list, it references a table (or two columns in a table) in the second field? It's essentiallys an if-this-than-that problem I think. Thank you
Table.RenameColumns(Source, {Titles Table}, MissingField.Ignore)
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If the columns of Titles Table are in the order <old name>, <new name>, you could create a step like this:
= Table.RenameColumns(Source, Table.ToRows(#"Titles Table"), MissingField.Ignore)
If "Titles Table" is a two-column table, Table.ToRows would convert it to a list of lists, each of which contains the items from one row in the same order as the columns.
Note that text comparisons are case-sensitive, so you would need to ensure the case of the original column names matches the case of the values in first column of "Titles Table".
Regards,
Owen
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If the columns of Titles Table are in the order <old name>, <new name>, you could create a step like this:
= Table.RenameColumns(Source, Table.ToRows(#"Titles Table"), MissingField.Ignore)
If "Titles Table" is a two-column table, Table.ToRows would convert it to a list of lists, each of which contains the items from one row in the same order as the columns.
Note that text comparisons are case-sensitive, so you would need to ensure the case of the original column names matches the case of the values in first column of "Titles Table".
Regards,
Owen
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you. That did the trick, but I did need to close and apply a couple times to get it to take.
Notes for the next person: in the title table, column one should be the old names and column two is the new names.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @ME_Evaluation ,
Please find the snap.Here you can directly double click the header it show's one dialog box then you can change column headers .
Else try below.
you can selcet you want to chnage first rows want to see headrs' .
thanks
gokul
Helpful resources
Join us at the Microsoft Fabric Community Conference
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Power BI Monthly Update - January 2025
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
Subject | Author | Posted | |
---|---|---|---|
12-03-2023 04:26 AM | |||
07-26-2023 12:31 PM | |||
12-15-2023 12:19 PM | |||
12-23-2022 01:10 AM | |||
02-15-2024 01:46 AM |
User | Count |
---|---|
101 | |
74 | |
43 | |
38 | |
31 |
User | Count |
---|---|
166 | |
90 | |
65 | |
46 | |
43 |