Forum Discussion

DWJames's avatar
DWJames
Regular Visitor
9 years ago
Solved

How to only Replace Values which end with a particular string? the equivalent of Regex $

Hi all, I'm moving some time-consuming data conversion processes into power BI, but I've hit a wall that I previously used to use multiple regex commands to handle value replacement and don't know t...
  • v-sihou-msft's avatar
    9 years ago

    DWJames

     

    Please try DAX formula below;

     

    Column = IF(RIGHT(Table1[Color],3)="Sil",
    	REPLACE(Table1[Color],LEN(Table1[Color])-2,3,"Silver")
    	,Table1[Color])

     

     

    Regards,