Forum Discussion

eeviste's avatar
eeviste
New Member
3 years ago
Solved

Compiling a new column value from multiple columns if only one of them has a value per row?

Hi all!   I am trying to create a new text column in Power BI desktop from four separate text columns within the same table. For each data row, only one of these four columns will have a text valu...
  • amitchandak's avatar
    3 years ago

    eeviste , Try one of the two way to create a new columns

     

    coalease([AgeGroup1],[UnknownAge],[UnknownAdult],[UnknownChild])

     

     

    Switch(True() ,
    not(isblank([AgeGroup1])) && [AgeGroup1]<>"", [AgeGroup1],
    not(isblank([UnknownAge])) && [UnknownAge]<>"", [UnknownAge],
    not(isblank([UnknownAdult])) && [UnknownAdult]<>"", [UnknownAdult],
    not(isblank([UnknownChild])) && [UnknownChild]<>"", [UnknownChild])