Forum Discussion

Pbiuserr's avatar
Pbiuserr
Icon for Post Prodigy rankPost Prodigy
4 years ago
Solved

IF with corresponding row value

Hello,

I've got a table like 

ZoneCategory
EuropeGlobal
AsiaGlobal
AmericaGlobal
Local GroceryLocal
Local AutomotiveLocal
Local HRLocal

 

and I want to create a calculated column to look like

ZoneCategoryResult of IF
EuropeGlobalEurope
AsiaGlobalAsia
AmericaGlobalAmerica
Local GroceryLocalLocal
Local AutomotiveLocalLocal
Local HRLocalLocal
  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi  Pbiuserr ,

    Here are the steps you can follow:

    1. Create calculated column.

    Result of IF =
    IF(
        'Table'[Category]="Global",
        'Table'[Zone],
        'Table'[Category])

    2. Result:

     

    If you need pbix, please click here.

    IF with corresponding row value.pbix

     

    Best Regards,

    Liu Yang

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

2 Replies

  • ddpl's avatar
    ddpl
    Icon for Solution Sage rankSolution Sage

    Pbiuserr use this

     

    Column = SWITCH(TRUE(),

              'Yourtable'[Category] = "Global",'Yourtable'[Zone],"Local")
  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi  Pbiuserr ,

    Here are the steps you can follow:

    1. Create calculated column.

    Result of IF =
    IF(
        'Table'[Category]="Global",
        'Table'[Zone],
        'Table'[Category])

    2. Result:

     

    If you need pbix, please click here.

    IF with corresponding row value.pbix

     

    Best Regards,

    Liu Yang

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly