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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
grprem81us
Frequent Visitor

Long Prefix match to get the Operator name

 

Hi All,

 

I have the list of Phone numbers and i need to do the Longest prefix match with DialCode range to get the Telecom Operators.

 

Can anyone help ?

 

 

4 REPLIES 4
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @grprem81us,

 

Please share more details for your scenario so that we could help further on it.

 

I would appreciated it if you could share some data which could reroduce your scenario and your desired output.

 

Best Regards,

Cherry

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

hi @v-piga-msft

 

I have a list of DialCode and it Operator. In Table 2 I have list of Phone numbers.

 

All i need to add a column in Table 2 , which will show me the which Operator they belong to.

 

Table 1 :

 

Resolved NameArea String
Afghanistan93
Afghanistan - Mobile AWCC9370
Afghanistan - Mobile AWCC9371
Afghanistan - Mobile Etisalat9373
Afghanistan - Mobile Etisalat9378
Afghanistan - Mobile MTN9376
Afghanistan - Mobile MTN9377
Afghanistan - Mobile Others9375
Afghanistan - Mobile Roshan9372
Afghanistan - Mobile Roshan9379
Afghanistan - Mobile Salam9358

 

Table 2 :

 

93585844????
937745????
937415????
93794455????
93794415????
93734415????

 

Hope these details is fine.

 

Thanks 

 

Hi @grprem81us,

 

For your scenario, I think Lookup value function could help you.

 

You could Spit columns in Query Editor to get the Area Sting num in Table 2 and Close and Apply.

 

spit.PNG

 

Then you could use Dax formula like below to get your requirement.

 

Column = 
LOOKUPVALUE(Table1[Resolved Name],'Table1'[Area String],'Table2'[Num])

lookupvalue.PNG

 

Hope this can make sense of you.

 

Best Regards,

Cherry

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi Cherry,

 

I want a Generic Solution. The dial codes are not 4 digits always. It can range from 1 to 11 Digits.

 

If you see your result below , 9374-15 should have got matched to "93" since 9374 is not there. But it is left Blank which is not expected.

 

Thanks in Advance.

 

Regards,

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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