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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
stephen1606
Frequent Visitor

Assigning Multiple Countries to a Value in a Filled Map

I am a complete novice with Power BI so I apologise in advance if this a very basic question. 

 

I'm trying to create a filled map to highlight the different countries a TV channel broadcasts to. It works fine when it only broadcasts to a single country but when a channel goes to multiple it will only highlight one on the map. 

 

I have tried keeping the countries in one column and separating them by a comma and I have also tried spliting them into different columns as in the example below, but it still only returns one country. 

Map_Query.png

 

Any help would be hugely appreciated. 

1 ACCEPTED SOLUTION

If you are working from a comma-separated list of countries, you can go into the Query Editor, then split the columns by each occurence of the comma delimiter. This creates a separate column for each country. You can then unpivot the new columns so that each country ends up on its own row for each channel so you won't have to do it manually.

 

Here's a sample sequence if your starting data looks like this:

A.PNG

 

 

B.PNG

 

 C.PNG

 

 D.PNG

 E.PNG

 

 F.PNG

 

Then "Close and Apply" and setup your Filled Map with the country ("Value" in the screenshot but which I would typically rename)

 

G.PNG

 

 

H.PNG

 

 

 

 

 

 

View solution in original post

5 REPLIES 5
deldersveld
Resident Rockstar
Resident Rockstar

You should be able to add each country as it's own row. Leave Country in Location and remove Regions. If Denmark and Sweden have the same value for Channel name, then they should both appear filled.

Thanks for responding. 

 

 

This works and will highlight the countries but is that the only way to do it as I will need to create a new row for every channel for every country it broadcasts to?

If you are working from a comma-separated list of countries, you can go into the Query Editor, then split the columns by each occurence of the comma delimiter. This creates a separate column for each country. You can then unpivot the new columns so that each country ends up on its own row for each channel so you won't have to do it manually.

 

Here's a sample sequence if your starting data looks like this:

A.PNG

 

 

B.PNG

 

 C.PNG

 

 D.PNG

 E.PNG

 

 F.PNG

 

Then "Close and Apply" and setup your Filled Map with the country ("Value" in the screenshot but which I would typically rename)

 

G.PNG

 

 

H.PNG

 

 

 

 

 

 

Thank you, that's great!

Sean
Community Champion
Community Champion

@stephen1606

You can automate this in the Query Editor

 

If you have a Channel column and then a column listing all countries per channel separated by ,

 

Split Column by delimiter - clean and trim the new columns - Unpivot the channel column - Close and Apply

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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