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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
ryanb11
Helper III
Helper III

Filter phone numbers from text field

I have a text field in a table where I need to substitute phone numbers where applicable.

 

For example the text field could have:

 

Call me on 08588812885

Call me on 07525812845

I need assitance please call me

 

Sometimes a phone number will be in the text but not always and the phone number entered will always be different.

 

Is there a measure to use to replace the phone numbers with no text

2 ACCEPTED SOLUTIONS
mussaenda
Super User
Super User

Hello @ryanb11 ,

Yes, that's possible, you can split them using this function in the energy query

2020_08_25_17_26_31_Untitled_Power_Query_Editor.png

I hope this helps!

View solution in original post

mussaenda
Super User
Super User

Oops, i'm sorry I didn't realize you posted a sample of data about the comments section.

I found this @MarcelBeug solution

Try this too:

2020_08_25_17_36_00_Untitled_Power_Query_Editor.png

I've attached the pbix sample.

You can go directly to Power Query to check it.

I hope this helps!

View solution in original post

11 REPLIES 11
Sujit_Thakur
Solution Sage
Solution Sage

Dear @ryanb11 ,
 if your column contain value such as "Call me on 21823283 its urgent !!!"
then
Do following steps ,

1) go to Transform data (after importing data )
2) Do split column non- digit to digit  you will get something like this 

Screenshot (91).png

3)Then agian select the second column and do " Digit to Non Digit:" as shown below, as second column which may contain some text as it is not fixed that always numbers will be on rightmost side .
4) Then select the first and rightmost column , and right click it will option merge and merge it.

Screenshot (94).png

 

then a tab will get open select " space " and give proper name 

Screenshot (95).png


 then you will get this "A FoolProof Solution" this means let data come in any sequence you must be able to handle without lifting pinky finger 

Screenshot (96).png


Please give kudos  to this post to motivate and if it helped , do accept as solution

Regards ,
Sujit

Anonymous
Not applicable

Hi @Sujit_Thakur 

Add a column with formulan the Query Editor

= Text.Combine(List.RemoveItems(Text.ToList([ColumnName]),{"0".."9"}))

Or

Choose Transform and adjust the code in the formula bar as below

= Table.TransformColumns(PreviousStep,{{"TextWithDigits", each Text.Combine(List.RemoveItems(Text.ToList(_),{"0".."9"}))}})

the adjustment is the part starting with "each".

the solution works partially the only issue if there are other numbers not as a phone number.

these get replaced when they need to be kept

so user cases are:

call me on 0845812856
call me on 0845812856 asap
cal me urgently
last contacted in 2019

arw you able to incorporate this into your custom column formula? @Anonymous 

the solution works partially the only issue if there are other numbers not as a phone number.

 

these get replaced when they need to be kept

 

so user cases are:

 

call me on 0845812856

call me on 0845812856 asap

cal me urgently

last contacted in 2019

 

arw you able to incorporate this into your custom column formula?

 

@Sujit_Thakur 

mussaenda
Super User
Super User

Oops, i'm sorry I didn't realize you posted a sample of data about the comments section.

I found this @MarcelBeug solution

Try this too:

2020_08_25_17_36_00_Untitled_Power_Query_Editor.png

I've attached the pbix sample.

You can go directly to Power Query to check it.

I hope this helps!

amitchandak
Super User
Super User

@ryanb11 , refer if remove number from text can help

https://community.powerbi.com/t5/Desktop/Removing-Numbers/td-p/146489

 

another way is data masking

https://radacad.com/secure-the-sensitive-data-in-power-bi-data-masking-better-with-row-level-securit...

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
mussaenda
Super User
Super User

Hello @ryanb11 ,

Yes, that's possible, you can split them using this function in the energy query

2020_08_25_17_26_31_Untitled_Power_Query_Editor.png

I hope this helps!

Sujit_Thakur
Solution Sage
Solution Sage

Dear @ryanb11  ,
Can you elaborate or explain properly with some excel sheet in which you can show what actually you want in power bi.
so that we could try to help

Regards ,
Thakur Sujit

i am trying to get rid of the phone numbers as they are personal information and want to exclude from the visuals

 

user id columntext comment columnmeasure result 
1Call me on 08588812885 as I have an issue I cannot fixCall me on as I have an issue I cannot fix
2I am not happy with the service Call me on 07525812845 as soon as possibleI am not happy with the service Call me on as soon as possible
3good servicegood service
Anonymous
Not applicable

Just to confirm your question: you are trying to extract the phone number, correct?

i am trying to get rid of the phone numbers as they are personal information and want to exclude from the visuals

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors