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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
ravgh
Regular Visitor

Modelling Custom Geographical Regions for Map Visual

Hi,

 

New to PowerBi and need help understanding how to model regions.

 

I'm working on creating a report that deals with multiple projects spread over several regions. Our company has custom geographical 'regions'. Some regions correspond to continents, while others are countries.

 

Dim Regions Table

 

RegionArea Covered
EUEurope
USUnited States
JPJapan
ASAsia
AZAustralia

 

The data looks like this:

 

Fact Projects Table

 

ProjectIDProject TitleRegionDepartment
1FrodoAZ, JP, EUIT
2BilboJP, ASFinance
3GandalfEU, US, JP, AS, AZIT
4MerryUS, EU, AZOperations

 

So far, I've been able to split the region column in FactProjects table as follows:

 

ProjectIDProject TitleRegion1Region2Region3Region4Region5Department
1FrodoAZJPEUnullnullIT
2BilboJPASnullnullnullFinance
3GandalfEUUSJPASAZIT
4MerryUSEUAZnullnullOperations

 

My main 2 issues are these:

 

1. How do I "count" projects towards multiple regions?

2. How do I do a map visualsation with these custom regions?

 

Thank you for your help.

 

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

In the Query Editor (where you split the Region column into multiple colukns), then is an option under Advanced to split by rows.  After splitting by rows, create a relationship from the Projects to the Regions table.  You should now be able to build your desired visuals. 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

8 REPLIES 8
ravgh
Regular Visitor

Note I've already created the realtionship, and also created a new measure for the Number of Projects card visual:

 

Screen Shot 2020-12-08 at 4.02.40 PM.pngScreen Shot 2020-12-08 at 4.03.01 PM.png

ravgh
Regular Visitor

I would provide the pbix file but apparently new members in this forum can't upload files here.

amitchandak
Super User
Super User

@ravgh , In power Query slip column by Delimiter into columns

https://www.tutorialgateway.org/how-to-split-columns-in-power-bi/

Ashish_Mathur
Super User
Super User

Hi,

In the Query Editor (where you split the Region column into multiple colukns), then is an option under Advanced to split by rows.  After splitting by rows, create a relationship from the Projects to the Regions table.  You should now be able to build your desired visuals. 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Thanks Ashish, really appreciate the help. I was able to split the data into rows, but the visuals still aren't working properly.

 

After splitting into rows:

After Splitting into RowsAfter Splitting into Rows

 

Map visual with no slicer selections:

Map with no slicer selectionMap with no slicer selection

 

 

Map with Japan selected in slicer. The number of projects for Japan should be 4, not 1. 

Slicer with Japan selected - the number of projects for Japan should be 4, not 1.Slicer with Japan selected - the number of projects for Japan should be 4, not 1.

You are welcome.  In the Query Editor column, right click on the Region column and trim the extra spaces.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

This worked! The rows needed to be trimmed, as you said. Thank you

You are welcome.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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