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
MJOS-WVI
Frequent Visitor

transform international phone numbers to country names

I'm trying to create a map visual in a dashboard from a list of international phone numbers.

 

My phone numbers are in a standard format, like this:

+[countrycode][area code][phonenumber

 

Below is an edited sample of what that data in my column looks like:

 

International phone #

  • +61421112233
  • +818001112233
  • +14165551111

 

I have a separate table of country codes and country names that I can match against ( so I know the first cell is Australia, the second is Japan, the third is Canada, etc.).

 

I need to isolate out the country code (which varies in length between 1 and 3 digits) from my column of international phone numbers. And then if country code is +61, then return "Australia", and if country code is +1 and area codes is 416, then return "Canada".

 

There is a way to use Power Query to transform the data, just need help.

 

I looked at this solution but it came up short.

Solved: Re: Match a phone number to a list of country code... - Microsoft Power BI Community

 

 

1 ACCEPTED SOLUTION
AlexisOlson
Super User
Super User

Here's the list of starting codes from the post you linked converted into M code you can paste into a new query:

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("nVrZcuM2Fv0VVD85Vd1VMnc+2vLSjpd4LLenkkweIAmm0CYBBSTlln9oKu/zB/1jc3EBaiGvnOUlHWO967nngvr11w+jDx8/PIhamJWYf/jt468fjpMsgrGTShg544pNeKW5mwkSnFFFK8tyM5bhWCOLljOu5uyUm2k776ajAKZP+YJXvGZHY11VWr0KXjYLpp9ZsxA/dAsTXGimfK5rNxZFx3ZMmGp7Hgp3amQj6wV7kqaQil3VJVzsN8VZCivGXPFuTzQKeyNpNuqNBGHSH4n7a9I0640ko6h/V3jcP2ewJh7170pHeW8kHwUDmfsjyXFfryQa6H7cvysK+2uCYKB71JcnHcW9kWzUPycfrAmy/jlh1Jc5TPq74uP+rizt78oGa6LjvnfirO+LOO3vio+HHuyfEw0iIQkHeg18miV9+4SR03Rd8V7Mprj2TFdSQc4N0sSnSIZe6VYp9iCW7bSUMz8bvDs7em82QvteGrGjYmqNd9nyqnOBVfBHSGPY75cgHNxq1Q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fJ2Mvlh2OhnWTDArTvRvGrzQjwLZFjX//pqKgKod9UMw/WRy1eu9jKNelrNXMHuu6BGE5/JGlkzmKmU4hmq9tlDZyYqTXIKQnMq8KnX1YyqvhlVfTOq+mZU9c2o6ptR1Tejqq9jHq15Ea67R13w8wFRQVCne/7i3pcPf91FNU+eiwVXuNQNoppGshuuXvjeV793gBvtcAsdWmU/jHQfAfxc15rMIeOoPj7HTuVGTDlkkB+xKvyoDX4G+8zrhahs2PfhN8d+ZbLGfnTvdwN+Gh92Df+dvNXKfN2+QmcORWmPnubYqkx4O5d4LAX9OX46+VlUgqI9OX43+cn+gOZo0pZg3f3z91DkEzP4vw50Zq0BltqUa9YCdTZMKjBbIwucddvTwY/h8nTnNxZoifNKWiJa+2kEhNpwUQ6UdY0RX9gnUUJPRPx/8cZ6tr8TXx0WLcbZcCM20faDbNd/5qlj9Ute/rUvk3lKZEiOGLyPV/cGIqSt2IOVb0vL7h88LcNMg0h4Nx8o2Mgx1R7xozbQDs6WRltYnzMFzYncE6IZFBB/w0yDS+ultq0QyFU7+YbYmmPqPvKvskteQsjQQ4F9iN+mLebtyZswUy6/HtiJX7yFNkXnDkSq67Up1m+9zKHgKncPGW9T8Y50g/L4DP0nnFK4SlZ3hP+3/wM=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Start = _t, Country = _t])
in
    Source

AlexisOlson_0-1635895445073.png

 

From here, we can define a new custom column that uses these codes:

(r) => Table.SelectRows(
           AreaCodes,
           each Text.StartsWith(
                    Text.AfterDelimiter(r[#"International phone #"], "+"),
                    [Start]
                )
       )[Country]{0}

This takes the first (index 0) row of the Country column after filtering the AreaCodes table (above) such that the phone number after the "+" starts with the code in the [Start] column.

 

Sample query including this custom column and referencing the first table:

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45W0jYzNDEyNDQ0MjI2VorVAQpYGFoYGKCIGJoYmpmamgLFDJViYwE=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"International phone #" = _t]),
    #"Added Custom" = Table.AddColumn(Source, "Country", (r) => Table.SelectRows(AreaCodes, each Text.StartsWith(Text.AfterDelimiter(r[#"International phone #"],"+"), [Start]))[Country]{0}, type text)
in
    #"Added Custom"

 

AlexisOlson_2-1635895732536.png

 

 

 

 

View solution in original post

3 REPLIES 3
v-henryk-mstf
Community Support
Community Support

Hi @MJOS-WVI ,

 

I think the advice @AlexisOlson  provided is worth taking into account. If the problem has been solved you can mark the reply for the standard answer to help the other members find it more quickly. If not, please point it out.


Looking forward to your reply.


Best Regards,
Henry

 

AlexisOlson
Super User
Super User

Here's the list of starting codes from the post you linked converted into M code you can paste into a new query:

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("nVrZcuM2Fv0VVD85Vd1VMnc+2vLSjpd4LLenkkweIAmm0CYBBSTlln9oKu/zB/1jc3EBaiGvnOUlHWO967nngvr11w+jDx8/PIhamJWYf/jt468fjpMsgrGTShg544pNeKW5mwkSnFFFK8tyM5bhWCOLljOu5uyUm2k776ajAKZP+YJXvGZHY11VWr0KXjYLpp9ZsxA/dAsTXGimfK5rNxZFx3ZMmGp7Hgp3amQj6wV7kqaQil3VJVzsN8VZCivGXPFuTzQKeyNpNuqNBGHSH4n7a9I0640ko6h/V3jcP2ewJh7170pHeW8kHwUDmfsjyXFfryQa6H7cvysK+2uCYKB71JcnHcW9kWzUPycfrAmy/jlh1Jc5TPq74uP+rizt78oGa6LjvnfirO+LOO3vio+HHuyfEw0iIQkHeg18miV9+4SR03Rd8V7Mprj2TFdSQc4N0sSnSIZe6VYp9iCW7bSUMz8bvDs7em82QvteGrGjYmqNd9nyqnOBVfBHSGPY75cgHNxq1QB8GN50G6217rSB3DaK3XIjwQadvu9BQI5WvW+FaTR7kDPdBX5KDWeJXT3hUjXsWjZNjeBzJ1YSLrkQcwESSa225kvjbLPhpp3JTV5Fm+EnqWYC/rUngVzMWUQq0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9c2o6ptR1Tejqq9jHq15Ea67R13w8wFRQVCne/7i3pcPf91FNU+eiwVXuNQNoppGshuuXvjeV793gBvtcAsdWmU/jHQfAfxc15rMIeOoPj7HTuVGTDlkkB+xKvyoDX4G+8zrhahs2PfhN8d+ZbLGfnTvdwN+Gh92Df+dvNXKfN2+QmcORWmPnubYqkx4O5d4LAX9OX46+VlUgqI9OX43+cn+gOZo0pZg3f3z91DkEzP4vw50Zq0BltqUa9YCdTZMKjBbIwucddvTwY/h8nTnNxZoifNKWiJa+2kEhNpwUQ6UdY0RX9gnUUJPRPx/8cZ6tr8TXx0WLcbZcCM20faDbNd/5qlj9Ute/rUvk3lKZEiOGLyPV/cGIqSt2IOVb0vL7h88LcNMg0h4Nx8o2Mgx1R7xozbQDs6WRltYnzMFzYncE6IZFBB/w0yDS+ultq0QyFU7+YbYmmPqPvKvskteQsjQQ4F9iN+mLebtyZswUy6/HtiJX7yFNkXnDkSq67Up1m+9zKHgKncPGW9T8Y50g/L4DP0nnFK4SlZ3hP+3/wM=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Start = _t, Country = _t])
in
    Source

AlexisOlson_0-1635895445073.png

 

From here, we can define a new custom column that uses these codes:

(r) => Table.SelectRows(
           AreaCodes,
           each Text.StartsWith(
                    Text.AfterDelimiter(r[#"International phone #"], "+"),
                    [Start]
                )
       )[Country]{0}

This takes the first (index 0) row of the Country column after filtering the AreaCodes table (above) such that the phone number after the "+" starts with the code in the [Start] column.

 

Sample query including this custom column and referencing the first table:

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45W0jYzNDEyNDQ0MjI2VorVAQpYGFoYGKCIGJoYmpmamgLFDJViYwE=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"International phone #" = _t]),
    #"Added Custom" = Table.AddColumn(Source, "Country", (r) => Table.SelectRows(AreaCodes, each Text.StartsWith(Text.AfterDelimiter(r[#"International phone #"],"+"), [Start]))[Country]{0}, type text)
in
    #"Added Custom"

 

AlexisOlson_2-1635895732536.png

 

 

 

 

This seems like it could work, and I understand (mostly) the code. Unfortunately I was unable to produce the same results in a new Query with my dataset, though I am admittedly a PowerBI novice. If only I could call someone to walk me through this...

Helpful resources

Announcements
July 2024 Power BI Update

Power BI Monthly Update - July 2024

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

July Newsletter

Fabric Community Update - July 2024

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