Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
admin11
Memorable Member
Memorable Member

How to replace value label TI with TT for SOURCE field ?

Hi All

 

I have a field = SOURCE , The value label have TI , TS 

I like to replace TI with TT and TS with SS

 

admin11_0-1616663478505.png

My PBI file :-

https://www.dropbox.com/s/z3w777jy4d8nynd/PBT_V2021_392%20TI_SI_GL%20rename%20TI%20with%20TT%20for%2...

 

Paul

1 ACCEPTED SOLUTION
v-yangliu-msft
Community Support
Community Support

Hi  @admin11  ,

Here are the steps you can follow:

1. Create calculated column.

Column =
SUBSTITUTE(
SUBSTITUTE(
SUBSTITUTE(
SUBSTITUTE('Table'[Column1],"TA","A"),
"TP","B"),
"TI","C"),
"TS","D")

2. Result:

v-yangliu-msft_0-1617169135130.png

 

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.

View solution in original post

13 REPLIES 13
v-yangliu-msft
Community Support
Community Support

Hi  @admin11  ,

Here are the steps you can follow:

1. Create calculated column.

Column =
SUBSTITUTE(
SUBSTITUTE(
SUBSTITUTE(
SUBSTITUTE('Table'[Column1],"TA","A"),
"TP","B"),
"TI","C"),
"TS","D")

2. Result:

v-yangliu-msft_0-1617169135130.png

 

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.

@v-yangliu-msft 

Thank you very much for your help , it work fine now. apprecaite very much.

Paul Yeo

v-yangliu-msft
Community Support
Community Support

Hi  @admin11  ,

Here are the steps you can follow:

1. Create calculated column.

Column 2 =
SUBSTITUTE(
    SUBSTITUTE(
    'Table'[Column],"TI","TT"),
    "TS","SS")

2. Result:

v-yangliu-msft_0-1617068974592.png

 

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.

@v-yangliu-msft 

 

Thank you very much for your support , your code work fine , but when i need add 2 more , again i get error , hope you can advise me how to work around .

SOURCE NEW =
SUBSTITUTE(
SUBSTITUTE(
'Source'[SOURCE],
"TA","A"),
"TP,"B"),
"TI","C"),
"TS","D")
v-yangliu-msft
Community Support
Community Support

Hi  @admin11  ,

Here are the steps you can follow:

1. Create calculated column.

Column = SUBSTITUTE('Table'[SOURCE],"TI","TT")

2. Result:

v-yangliu-msft_0-1617005525564.png

 

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.

@v-yangliu-msft 

 

Thank you very uch for your help , your code is working fine.

I also want to repalce TS with SS.

I try below code :-
SOURCE_NEW = SUBSTITUTE('Source'[SOURCE],"TI","TT","TS","SS")
I get error msg :-

admin11_0-1617020176907.png

 

Anonymous
Not applicable

Go to power query editor and use Replace Values button from transform

Kesha_Shah_0-1616664240851.png

 

@Anonymous 

That field is not availabel at PQ.

Paul

Anonymous
Not applicable

I can see it ina acreenshot sent by you.

Kesha_Shah_1-1616664584138.png

Look at the yellow highlighter.

amitchandak
Super User
Super User

@admin11 , Do it power query, Right click replace

https://www.youtube.com/watch?v=hkZhZbR7Kmk

@amitchandak

May i know how to do it at DAX , as SOURCE is not available at PQ. 

admin11_0-1616664141317.png

 

 

@admin11 , in DAX you can use substitute

https://www.youtube.com/watch?v=y5HvChhMWbQ

substitute ([Column], "TI", "TT")

@amitchandak 

Thank you very much for your help , i get error :-

By the way i have TS want to change to SS 

and TI change TT.

admin11_0-1616664712479.png

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.