Forum Discussion

sandraemma's avatar
sandraemma
Frequent Visitor
3 years ago
Solved

Show correct column based on its value

Hello,    I am trying to create a plain table in Power BI but I am having trouble figuring out how to add a column based on values from basically two columns. I am getting duplicate rows since the ...
  • bhelou's avatar
    3 years ago

    Hello , 

    give this a try 


    New Column =
    IF(
    CONTAINSSTRING(Table1[col1], "See col2"),
    Table1[col2],
    Table1[col1]
    )
    & " " &
    IF(
    CONTAINSSTRING(Table1[col1], "See col2"),
    "",
    DISTINCT(Table1[col1])
    )

    Regards, 
    Please consider accepting this as a solution !! Respect your KUDO !! 
    I appreciate your recognition and feel proud to have been able to assist you.