Forum Discussion

PaiYa's avatar
PaiYa
Frequent Visitor
1 year ago
Solved

Different Filed Name Between Power BI and Power Query

In the Power BI model, the field names are not fully aligned with those in Power Query (PQ). My data source is Dynamics 365 (Dataverse), and the specific connection code in Power Query is:
= CommonDataService.Database("***.crm.dynamics.com", [CreateNavigationProperties=false])
After importing the data and performing a series of steps in Power Query (including renaming fields), I successfully loaded the data into the Power BI model. However, I found that while some of the renamed fields took effect as intended, others did not. I used the following code:

= Table.RenameColumns(#"Removed Other Columns", {{"accountid", "Account ID"}, {"name", "Account Name"}})
the changes did not fully reflect in the model. This issue persists even when I try the same query in a brand-new Power BI file, and it occurs across several of the tables I’m using.

As a result, I have to manually rename the fields again inside the Power BI model, which is inconvenient and may cause problems when making further updates.
My Rename Code:

Last Step in PQ(the way it should be): 

Field in Power BI:

 

16 Replies

  • v-hjannapu's avatar
    v-hjannapu
    Community Support

    Hi PaiYa,

    I would also take a moment to thank jaineshpHarishKM  for actively participating in the community forum and for the solutions you’ve been sharing in the community forum. Your contributions make a real difference.

    I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions.

    Best Regards,
    Harshitha.

    • jaineshp's avatar
      jaineshp
      Memorable Member

      Hey v-hjannapu,

      Thank you for the kind recognition - always happy to contribute to our community's success!

      Best Regards,
      Jainesh Poojara | Power BI Developer

    • v-hjannapu's avatar
      v-hjannapu
      Community Support

      Hi PaiYa,
      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.

      • PaiYa's avatar
        PaiYa
        Frequent Visitor

        Hi v-hjannapu 

        I try almost each way offered, but none of them worked. I think it may be a "bug" of application. Anyway,

        thank them for their kindly help and your attention.

  • jaineshp's avatar
    jaineshp
    Memorable Member

    Hey PaiYa,

    • Cache Clear First: Always try clearing Power BI's cache (File > Options > Data Load > Clear Cache). It's often the culprit.

    • PQ Step Order: Make sure your RenameColumns step is after any filtering/removing steps that might use old names.

    • Simple Test: Try renaming just one problematic column in a new, simple query. Does that one stick?

    • Update Power BI: Old versions can have quirky bugs. Ensure your Desktop is current.

    • Last Resort: If nothing else, sometimes removing the column and immediately adding it back with the new name in PQ forces it.

    Hope this helps you ditch the double-renaming!

    Did it work? ✔ Give a Kudo • Mark as Solution – help others too!

    Best regards,
    Jainesh Poojara / Power BI Developer

    • PaiYa's avatar
      PaiYa
      Frequent Visitor

      Hi jaineshp, thanks for your reply.

      • I don't find Clear Cache in Options. (My Power BI Desktop verson is the newest)


      • Of course.
      • Still no. I remain only one column and remove all transform step except Data Load and Rename.
      • My Power BI Desktop verson is the newest.
      • I am not sure about your word. When a column is removed, how could it added back?

       

       

      • jaineshp's avatar
        jaineshp
        Memorable Member

        Hey PaiYa,

        Looking at your screenshots and the issue you're describing, this appears to be a known behavior with Dataverse/Dynamics 365 connections in Power BI. Let me provide you with some targeted solutions:

        Root Cause

        This is a known issue with Dataverse connections where Power BI's metadata cache doesn't always reflect Power Query column renames, especially for system fields like accountid, name, etc.

        Solution 1: Force Metadata Refresh (Recommended)

        // In Power Query, after your rename step, add this:
        = Table.TransformColumnTypes(#"Renamed Columns", {{"Account ID", type text}, {"Account Name", type text}})


        This forces Power BI to recognize the new column names by explicitly setting data types.


        Solution 2: Alternative Rename Method


        Instead of Table.RenameColumns, try using Table.SelectColumns with new names:


        = Table.SelectColumns(#"Previous Step", {
        {"accountid", "Account ID"},
        {"name", "Account Name"},
        // Add other columns you need
        })

        Solution 3: Dataverse-Specific Workaround

        = CommonDataService.Database("***.crm.dynamics.com", [
        CreateNavigationProperties=false,
        UseDisplayNames=false // Add this parameter
        ])


        Solution 4: Clear Power BI Cache (Correct Location)

        The cache clearing option is actually here:

        • File > Options and Settings > Options
        • Data Load tab (left panel)
        • Data Cache Management Options
        • Click Clear Cache

        Solution 5: Column Recreation Method

        What I meant by "remove and add back":

        1. In Power Query, use Table.RemoveColumns to remove the problematic column
        2. Then use Table.AddColumn to create a new column with the desired name, copying data from another source column
        3. This forces a complete metadata refresh

          // Example:
          #"Removed Column" = Table.RemoveColumns(#"Previous Step", {"accountid"}),
          #"Added Custom" = Table.AddColumn(#"Removed Column", "Account ID", each [accountid_backup])

        Solution 6: Model-Level Fix

        If Power Query renames still don't work:

        1. In the Model view, select the problematic columns
        2. In the Properties pane, change the Display Name
        3. This overrides the Power Query name for report purposes

        Prevention Tips

        • Always apply column renames as the last transformation step
        • Avoid renaming Dataverse system columns if possible
        • Use Display Names in the model instead for user-facing names
        • Consider using calculated columns with DAX if renames persist in failing


        Did it work? ✔ Give a Kudo • Mark as Solution – help others too!

        Best regards,
        Jainesh Poojara / Power BI Developer

  • Hi PaiYa ,

     

    I have never experienced a question like this, and without further information is difficult to pinpoint what is happening. What I can suggest is that you try and rename the columns in the Desktop and not in Power Query, this will add a new step to the Power Query also, but it should persist the name in the model.

     

    Can you please try and let me know the result.

    • PaiYa's avatar
      PaiYa
      Frequent Visitor

      Hi MFelix , thanks for you reply.

      I'm not sure whether your reference to "Desktop" means Power BI Desktop. My workflow is: import data from Dynamics 365 → Transform Data → edit data in Power Query → load into Power BI. I'm not renaming fields in a local Excel file or anything like that — I'm renaming them in Power BI Desktop during the Transform Data step, but the changes are not taking effect.

      • MFelix's avatar
        MFelix
        Super User

        Hi PaiYa ,

         

        When I refer Desktop is the Power BI Desktop. What I mean is after you have done the load from the Power Query just double click the column name or Right click and select rename the column. Has I refer this will generate a step on Power Query automatically.

        Then refresh the model and check if the name persists or not.

         

  • PaiYa Hey,
    Kindly follow below steps.

     

    1. Some renamed fields in Power Query are not correctly reflected in the Power BI model.

    2. This inconsistency forces manual renaming within the model, leading to potential update challenges.

    3. Ensure renaming is applied as the final step before loading data to improve alignment.

    4. Verify that all transformations propagate correctly from Power Query to the model.

    Thanks

    Harish KM

    If these steps help resolve your issue, your acknowledgment would be greatly appreciated.

    • v-hjannapu's avatar
      v-hjannapu
      Community Support

      Hi PaiYa,
      Thank you for your update. I'm glad to hear your issue has been resolved. Please continue using the Fabric community.

      Best Regards,
      Harshitha.