Forum Discussion

Sander123's avatar
Sander123
Regular Visitor
8 years ago
Solved

Changing column names using M coding screws up Tables

I found a solution to rename column names automatically based on content of a certain column using the following command:

 

  #"Renamed Columns" = Table.RenameColumns(Source,{{"Value", Source[ReportDate]{0}}}),

Although this works, if also screws up the tables because the "name reference" will change. This results in the following error/problem:Before i had dates  22 and 23. After updating i have dates 22 and 24. Because 23 changed to 24, Power Bi doenst reconizes the value to use anymore. Is this possible to fix using some other lines of code?

 

 

 

  • Hi Sander123,

     

    By my test and confirmed, this is a limitation in Power BI currently.

     

    When we refer to other values to rename the column name which option is complex, we will encountr this error. We only to click "Fix this" and drag the column again.

     

    Best Regards,

    Cherry

1 Reply

  • v-piga-msft's avatar
    v-piga-msft
    Resident Rockstar

    Hi Sander123,

     

    By my test and confirmed, this is a limitation in Power BI currently.

     

    When we refer to other values to rename the column name which option is complex, we will encountr this error. We only to click "Fix this" and drag the column again.

     

    Best Regards,

    Cherry