Forum Discussion

Bebo's avatar
Bebo
Icon for Helper II rankHelper II
3 years ago
Solved

Replace Value in One Column based upon condition in another Column

I am trying to create a dax expression that will replace the value in one column based upon a condition in another column. For instance, in the following table, if the "gamecode=1" in Type Column), r...
  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi Bebo,

    You can create a calculated column with SUBSTITUTE function to repalce values based on other column values:

    Replaced =
    IF (
        Table[Type] = "gamecode",
        SUBSTITUTE ( Table[Type], "code", Table[Type ID] )
    )

    Regards,

    Xiaoxin Sheng

  • Bebo's avatar
    Bebo
    3 years ago

    Thank you - worked perfectly.