Forum Discussion

HemanthV's avatar
HemanthV
Helper II
4 years ago
Solved

Concatenate cell value to Column Name

Hi Guys,

 

I have data like below

 

CountryCityPeriod

AaaP8
AbbP8
AccP8
AddP8
BeeP8
BffP8
BggP8
BhhP8
BiiP8
CjjP8
CkkP8

 

I want P8 value to be concatenated for "City" Column name so the column name will be "City (P8)". How to achieve this?

 

Attaching pbix for referrence

https://drive.google.com/file/d/1Fue2wfzz9GtOg6qTl9K-Nd1veLAuAif9/view?usp=sharing

 

Please help me on this!

Thanks in advance!

  • NewStep= Table.RenameColumns(PreviousStepName,{"City","City ("&PreviousStepName[Period]{0}&")"})

6 Replies

  • wdx223_Daniel's avatar
    wdx223_Daniel
    Community Champion

    NewStep= Table.RenameColumns(PreviousStepName,{"City","City ("&PreviousStepName[Period]{0}&")"})

    • HemanthV's avatar
      HemanthV
      Helper II

      wdx223_Daniel ,

       

      Now whenever the value changes column name changes, this is working fine but when i click on close and apply visual is getting error because column name got changed right. Is there any way to handle this situation?