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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Help Needed with Containsstring formula

I've got a column containing Phone numbers and I need to identify the mobile phone numbers.
The Dutch Mobile phone numbers are identified when the number:

- Starts with +316
- Starts with 00316
- Starts with 06

I've got the following formula and this works fine:

Type Phonenumber =
SWITCH(TRUE(),
CONTAINSSTRING('Maia Data - Shell SSPF'[maia.Persoon.telefoon(1)],"+316"),"Mobiel",
CONTAINSSTRING('Maia Data - Shell SSPF'[maia.Persoon.telefoon(1)],"00316"),"Mobiel","Anders")

However if I want to add CONTAINSSTRING('Maia Data - Shell SSPF'[maia.Persoon.telefoon(1)],"06"),"Mobiel" to this formula, it will recognize any number containing 06 as a mobile phone, which is incorrect.

So how can I make sure that the formula works correctly?

With kind regards,

Lazzanova
1 ACCEPTED SOLUTION
Anonymous
Not applicable

HI

Perhaps for "06" you should use left('Maia Data - Shell SSPF'[maia.Persoon.telefoon(1)],2). There is a lot of 06 insude tl numbers

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

HI @Anonymous,

I think CONTAINSSTRING function may not suitable for your scenario, I'd like to suggest you take a look at the following blog about string comparisons and it includes 'start with', 'end with', 'contains', and fuzzy matches based on Dax expressions:

From SQL to DAX: String Comparison 

Regards,

Xiaoxin Sheng

Anonymous
Not applicable

HI

Perhaps for "06" you should use left('Maia Data - Shell SSPF'[maia.Persoon.telefoon(1)],2). There is a lot of 06 insude tl numbers

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.