Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago

replace value in calculated table

How to replace value in calculated table with condition or select any specific columns.

 

SSL =


VAR Unique_SSL = DISTINCT(
    UNION(
        VALUES('Base file Current week'[SSL]),
        VALUES(CIS[SSL]),
        VALUES(YOY[SSL]),
        VALUES('YTD Utilization'[_SSL])
        )
    )


VAR Updated_Table  = ADDCOLUMNS(Unique_SSL,"_SSL",REPLACE(Unique_SSL[SSL],1,1,1))

 return Updated_Table

1 Reply

  • Hi Anonymous -replace or modify values based on your requirements 

    SSL =
    VAR Unique_SSL = DISTINCT(
    UNION(
    VALUES('Base file Current week'[SSL]),
    VALUES(CIS[SSL]),
    VALUES(YOY[SSL]),
    VALUES('YTD Utilization'[_SSL])
    )
    )
    VAR Updated_Table =
    ADDCOLUMNS(
    Unique_SSL,
    "_SSL",
    IF(
    NOT(ISBLANK([SSL])),
    "1" & MID([SSL], 2, LEN([SSL]) - 1), // Replace the first character with '1'
    BLANK() // Or handle other conditions as needed
    )
    )
    RETURN
    Updated_Table

     

     

     

    Hope it works