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

Try your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join now

Reply
Nazdac2024
Advocate I
Advocate I

Simple Way to Handle Column Renames in Power BI?

Hi all,
I asked something similar before but the answers were a bit too advanced for me, so I’ll try to explain it in a simpler way.

I have an Excel file imported into Power BI.

In Power Query I applied some ETL steps, and on the report side I built visuals and measures.

 

Now the backend team renamed many columns, which caused my queries, visuals, and measures to break.

I do have a mapping table with the old and new column names, but since it’s a few hundred columns, updating everything manually would be a nightmare.

Is there an easy way to automatically apply these changes across Power Query, visuals, and measures?

Thanks in advance!


Note: I want the visuals and semantic model to display the new column names.
That’s why applying the mapping before loading the data into the report is good but will not achieve the gaol 🙂 
My data : 

Nazdac2024_0-1756979220921.png

Mapping table :

Nazdac2024_1-1756979247387.png

 

1 ACCEPTED SOLUTION
Gabry
Super User
Super User

Hey,

I think it should be enough if you add a step in power query to rename the columns using the mapping table, you should try to add this step

= Table.RenameColumns(PreviousStep, List.Zip({MappingTable[OldColumnName], MappingTable[NewColumnName]}), MissingField.Ignore)

 

I created an example PBIX file for you (attacched). Feel free to check it out.

 

View solution in original post

14 REPLIES 14
Nazdac2024
Advocate I
Advocate I

I have a Power BI solution with reports connected to Databricks tables.
The backend team is planning to change the naming conventions, meaning all table and column names will be updated.
This will cause issues in the frontend (visuals, measures, and applied filters will break).

I already have mapping tables for all the changes.
Is there a way to apply these changes automatically to my reports, for example with a script that updates everything?

Thanks in advance!

 

Thanks all 
I think these solution is adavnce for me .. 
I just updated my request , please see the new question and I will highly appricate finsing a simple to follwo steps to solve this 🙂 🙂 🙂 
Thanks 
Simple Way to Handle Column Renames in Power BI? - Microsoft Fabric Community

Hi @Nazdac2024 ,

there isn’t a built-in “auto rename” feature in Power BI, but there are some ways to handle this:

  1. Power BI External Tools – tools like Tabular Editor or ALM Toolkit let you script bulk changes across your model (rename tables/columns using your mapping).

  2. Script with TOM (Tabular Object Model) – you can write a small C#/PowerShell script with TOM API to loop through fields and apply your mapping automatically.

  3. Power Query – in some cases, apply renaming at the query step (using the mapping table), so visuals still see the “old names” even if backend changes.

Docs: Tabular Editor – Best Practice for renaming

👉 This avoids manually fixing every visual.

If this helps, please mark it as a solution
— Nabha Ahmed (connect with me on https://www.linkedin.com/in/nabha-ahmed-166491221?utm_source=share&utm_campaign=share_via&utm_conten...(

To automate Power BI updates after Databricks renaming:
- Use Tabular Editor or TOM scripting to rename tables/columns in your model using your mapping table.
- Validate broken visuals/measures post-renaming.
- Deploy updated PBIX via Power BI REST API or Power Automate.
- For future-proofing, connect Power BI to stable views in Databricks instead of raw tables.

Shahed Shaikh

Hello !

You can re-bind but don’t rename (no visual/measures break)

What you can change ? You need to point each table query to the new Databricks table name (and schema/catalog if that changed) and for each model column, switch its SourceColumn to the new physical column name.

What you do not change ?the table name and column name in the model and visuals, relationships, measures, roles, calc groups, perspectives keep working.

You can go to Tabular Editor (Desktop model or via XMLA on Premium/PPU) and use Advanced Scripting with a mapping you already have.

// Tabular Editor (Advanced Scripting) – bulk rebind to renamed Databricks objects.
// 1) Fill these maps from your mapping tables:
var tableMap = new System.Collections.Generic.Dictionary<string,string> {
    // {"PhysicalOldTableName","PhysicalNewTableName"}
    // {"sales_order_hdr","sales_order_header"}
};

var columnMap = new System.Collections.Generic.Dictionary<string,System.Collections.Generic.Dictionary<string,string>> {
    // {"ModelTableName" : { "PhysicalOldColumn" : "PhysicalNewColumn", ... } }
    // ModelTableName = table name as it appears in Power BI (friendly name)
    // {"Sales Orders", new(){ {"ord_id","order_id"}, {"cust_id","customer_id"} } }
};

// 2) Update partition queries (M) to point to the new physical table names:
foreach (var t in Model.Tables.ToList())
{
    foreach (var p in t.Partitions)
    {
        var msrc=p.Source as MPartitionSource;
        if (msrc != null)
        {
            var expr = msrc.Expression ?? "";
            foreach (var kvp in tableMap)
            {
                // naive replace: good if your M references native table names.
                expr = expr.Replace(kvp.Key, kvp.Value);
            }
            msrc.Expression = expr;
        }
        // (If you use native SQL queries instead of M, detect and replace there similarly.)
    }
}

// 3) Rebind columns to new physical column names (keep friendly names unchanged):
foreach (var t in Model.Tables)
{
    if (!columnMap.ContainsKey(t.Name)) continue;
    var map = columnMap[t.Name];
    foreach (var c in t.Columns.OfType<DataColumn>())
    {
        var oldPhys = c.SourceColumn;
        if (oldPhys != null && map.TryGetValue(oldPhys, out var newPhys))
        {
            c.SourceColumn = newPhys; // <-- rebind
        }
    }
}

// 4) Optional: if your Databricks catalog/schema changed, update data sourc here.

// 5) Save. Then refresh a small table to smoke test before full refresh.

You run this once against the shared dataset (or your PBIX model) because you don’t rename the model fields and your reports keep working.

If you can touch the lakehouseor Unity Catalog, you  create views with the old names that select the new columns:

CREATE OR REPLACE VIEW old_schema.sales_order_hdr AS
SELECT
  order_id   AS ord_id,
  customer_id AS cust_id,
  ...
FROM new_schema.sales_order_header;

and point PBI to those views then migrate at your pace to the new physical names. 


Proud to be a Power BI Super User !

Microsoft Community : https://docs.microsoft.com/en-us/users/AmiraBedhiafi
Linkedin : https://www.linkedin.com/in/amira-bedhiafi/
StackOverflow : https://stackoverflow.com/users/9517769/amira-bedhiafi
C-Sharp Corner : https://www.c-sharpcorner.com/members/amira-bedhiafi
Power BI Community :https://community.powerbi.com/t5/user/viewprofilepage/user-id/332696
v-venuppu
Community Support
Community Support

Hi @Nazdac2024 ,

I wanted to check if you had the opportunity to review the information provided and resolve the issue..?Please let us know if you need any further assistance.We are happy to help.

Thank you.

v-venuppu
Community Support
Community Support

Hi @Nazdac2024 ,

Thank you for reaching out to Microsoft Fabric Community.

Thank you @Shahid12523 @danextian @Royel @Gabry for the prompt response.

Maintain a mapping table with Old Column - New Column. Update it whenever backend renames columns.

Use Power Query to rename columns dynamically: convert the mapping table to a list of {Old, New} pairs and apply Table.RenameColumns with MissingField.Ignore.

Load the renamed table into Power BI - visuals and semantic model will now show the new column names.

Update DAX measures referencing old columns, or use Tabular Editor for bulk search-and-replace.

 Works for hundreds of columns automatically, keeps visuals and measures intact, and is easy to maintain.

Nazdac2024
Advocate I
Advocate I

Hi all 
Thanks a alot for fast help , I just added this not :
Note: I want the visuals and semantic model to display the new column names
Sorry for the incomlete data 🙂 
Regards 

Shahid12523
Community Champion
Community Champion

- Use your mapping table to automate renames instead of fixing everything manually.
- In Power Query, dynamically rename columns using the mapping table before loading data.
- In the model (measures/visuals), use tools like Tabular Editor to bulk rename columns based on your mapping—this avoids breaking visuals.
- Avoid manual edits in visuals or measures, as that’s error-prone and slow.

Shahed Shaikh
danextian
Super User
Super User

Hi @Nazdac2024 

When you rename a column in Power Query, it works with a list of lists. For example:

{{"SheetorRangeId", "SheetorRangeId2"}, {"Data", "Data2"}}

That’s the structure you’re trying to replicate.

If you already have a query that contains your column name mappings, you can reference those directly. Just make sure the columns you’re renaming actually exist in the table:

= Table.RenameColumns( #"Previous Step Name", List.Zip({MappingTable[OldColumns], MappingTable[NewColumns]}) )

Here, MappingTable[OldColumns] and MappingTable[NewColumns] each become a list (a single column of values). Table.RenameColumns needs these pairs of old name - new name to sit next to each other. That’s where List.Zip comes in - it takes the two separate lists and stitches them together row by row, just like zipping up a jacket where each tooth from one side lines up with the matching one on the other.

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
Royel
Super User
Super User

Hi @Nazdac2024  You can solve this issue with help of TMDL view. 

Step 1: Open TMDL window

Step 2: Bring your data table (which one causing issue) in the TMDL view

Step 3: Here, our gole is to not change column name, we need to update only sourceColumn 

Royel_0-1756981455882.png

Step 4: Now copy the TMDL script and give it to any gpt. also, share your mapping column data. and asked to only update sourceColumn name based on column name. 

Step 5: Pest your updated TMDL script here and click apply. 

Now, all your visual, measure will remain same with updated source column name. 

 

Find this helpful? ✔ Give a Kudo • Mark as Solution – help others too!

Gabry
Super User
Super User

Hey,

I think it should be enough if you add a step in power query to rename the columns using the mapping table, you should try to add this step

= Table.RenameColumns(PreviousStep, List.Zip({MappingTable[OldColumnName], MappingTable[NewColumnName]}), MissingField.Ignore)

 

I created an example PBIX file for you (attacched). Feel free to check it out.

 

Is this going to update also colmun names in measures and visuals , so they will not collapse? 

Nope, the goal is to take the new column names from the source and rename them back to the old ones, so nothing breaks.
(To avoid breaking the query, a step needs to be added in PQ. However, the column names in the report will remain unchanged)

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.