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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
RBPI
New Member

How to hide Phone numbers, but the last 4 digits

Dear Memebers, 

A quick question came-up and it's about data masking. I'm working on a project which requires to replace the 6 digits of all customers phone numbers but not the last 4. However, the phone number should be searchable when someone types the whole number. It's also required that if the report is printed, phone numbers should be masked and only the last 4 digits should be visible. 

 

Ex. A phone number like 777-777-7777 should be XXX-XXX-7777. But, when someone is searching and using the full number on the PowerBi report- 777-777-7777 it should result to a success and show the rest of the coulmns in the report. 

 

Thanks for you help here 🙂 

1 ACCEPTED SOLUTION
SamInogic
Super User
Super User

Hi @RBPI ,

 

You can try to create a new custom column with below DAX expression,

 

Masked Phone Number = SUBSTITUTE(Phones[Phone Number], LEFT(Phones[Phone Number], LEN(Phones[Phone Number])-4),"XXX-XXX")

 

Please refer to the below screenshot for the same,

SamInogic_6-1690973559906.png

 

Thanks!

Inogic Professional Services Division

Power Platform and Microsoft Dynamics 365 CRM Development – All under one roof!

Drop an email at crm@inogic.com

Services:  http://www.inogic.com/services/

Power Platform/Dynamics 365 CRM Tips and Tricks:  http://www.inogic.com/blog/

Inogic Professional Services: Power Platform/Dynamics 365 CRM
An expert technical extension for your techno-functional business needs
Drop an email at crm@inogic.com
Service: https://www.inogic.com/services/
Tips and Tricks: https://www.inogic.com/blog/

View solution in original post

2 REPLIES 2
SamInogic
Super User
Super User

Hi @RBPI ,

 

You can try to create a new custom column with below DAX expression,

 

Masked Phone Number = SUBSTITUTE(Phones[Phone Number], LEFT(Phones[Phone Number], LEN(Phones[Phone Number])-4),"XXX-XXX")

 

Please refer to the below screenshot for the same,

SamInogic_6-1690973559906.png

 

Thanks!

Inogic Professional Services Division

Power Platform and Microsoft Dynamics 365 CRM Development – All under one roof!

Drop an email at crm@inogic.com

Services:  http://www.inogic.com/services/

Power Platform/Dynamics 365 CRM Tips and Tricks:  http://www.inogic.com/blog/

Inogic Professional Services: Power Platform/Dynamics 365 CRM
An expert technical extension for your techno-functional business needs
Drop an email at crm@inogic.com
Service: https://www.inogic.com/services/
Tips and Tricks: https://www.inogic.com/blog/

@samlnogi - Thank you very much for your input here. The function you recommended worked, but I also figured it out with DAX Replace Function. I'll accept your recommandation as a solution to this. Thanks again!

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

AugPowerBI_Carousel

Power BI Monthly Update - August 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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