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

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

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
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.