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
leneprd
Regular Visitor

Replace part of value

hai.. Anyone pls help me...

I have a coloum name ID, and I want ti replace part of the value with xxxx. Example :

 

ID

12345678

23456789

17654328

 

I want to change a 4 last number with xxxx. it will look like :

 

ID

1234XXXX

2345XXXX

1765XXXX

 

TQ

 

 

2 ACCEPTED SOLUTIONS
ChandeepChhabra
Impactful Individual
Impactful Individual

@leneprd You can add a calculated column with the following formula 

 

=SUBSTITUTE(Table1[ID],RIGHT(Table1[ID],4),"XXXX")

 

Results will look like this 

Capture.PNG

View solution in original post

v-xjiin-msft
Solution Sage
Solution Sage

Hi @leneprd,

 

Also, you can try a Power Query method:

 

Go to Edit Queries -> Add a Custom Column

 

=Text.Replace(Number.ToText([ID]),Text.End(Number.ToText([ID]),4),"xxxx")

2.PNG

 

Thanks,
Xi Jin.

View solution in original post

4 REPLIES 4
v-xjiin-msft
Solution Sage
Solution Sage

Hi @leneprd,

 

Also, you can try a Power Query method:

 

Go to Edit Queries -> Add a Custom Column

 

=Text.Replace(Number.ToText([ID]),Text.End(Number.ToText([ID]),4),"xxxx")

2.PNG

 

Thanks,
Xi Jin.

Try this method too... Got it

 

TQSM

ChandeepChhabra
Impactful Individual
Impactful Individual

@leneprd You can add a calculated column with the following formula 

 

=SUBSTITUTE(Table1[ID],RIGHT(Table1[ID],4),"XXXX")

 

Results will look like this 

Capture.PNG

Got it.

 

TQSM

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.