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
dokat
Post Prodigy
Post Prodigy

Power BI Map - Sales Data

Hi,

 

I am trying to map out my sales data with power bi. Below is the format of my census division data. I dont have longtidue or lattiudue . Based on below census divisions is it possible to map out my data in power bi?

 

Census DivisionMeasuresValues
New EnglandDollars$13,024
Middle AtlanticDollars$11,044
East North CentralDollars$22,402
West North CentralDollars$13,233
South AtlanticDollars$17,095
East South CentralDollars$13,997
West South CentralDollars$14,064
MountainDollars$10,279
PacificDollars$7,849
South AtlanticDollars$710
East South CentralDollars$391
New EnglandDollars$1,899
Middle AtlanticDollars$4,363
East North CentralDollars$8,963
West North CentralDollars$3,282
South AtlanticDollars$5,818
East South CentralDollars$1,677
West South CentralDollars$2,318
5 ACCEPTED SOLUTIONS

@dokat 

 

Grab the JSON files for the US census regions, add them to your shape, and you've got exactly what you need:

For US maps:  https://github.com/d3/d3/wiki/gallery/#maps

(original source: https://community.powerbi.com/t5/Desktop/US-states-Shape-Map-JSON-file/m-p/79071)

 

This should resolve the problem 🙂

 

 

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

View solution in original post

@dokat check this link out: https://docs.microsoft.com/en-us/power-bi/visuals/desktop-shape-map

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

View solution in original post

@dokat it should be one of the following: https://www.census.gov/geographies/mapping-files/time-series/geo/carto-boundary-file.html

 

Try one of the Nation or Region zips.

 

Cheers

Theo

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

View solution in original post

@dokat you may need to convert to JSON: https://www.statsilk.com/maps/convert-esri-shapefile-map-geojso

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

View solution in original post

@TheoC  I am using a measure not pulling it from field pane. I went back to the original plan, brought in US States Geo Json file into power bi. Created a table with Census Division and States and linked it to the source data.  I have below formula to calculate the average sum for each census divison. It worked for me ut hd to get creative. I couldnt have done without help of @TheoC. Thank you! 

 

POS Sales = var _currentCensus = MAX(Region[Census Division])
var _sum = SUM(Region[Values])
var _uniquestates = CALCULATE(DISTINCTCOUNT(Map[State]),
    Region[Census Division]=_currentCensus)

var _calculation = DIVIDE(_sum,_uniquestates)
return _calculation

 

 

 

dokat_0-1646168301445.png

 

View solution in original post

19 REPLIES 19
TheoC
Super User
Super User

Hi @dokat 

 

Given the limited data accuracy, it is likely you'd have some inaccurate points on the respective map.  You could amend slightly to allocate a State and Country to help mitigate these.

 

The below is what you will end up with if you're using the Map visual.

 

TheoC_0-1646106214063.png

 

As mentioned, there will be some limitations.

 

All the best.

Theo

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

@TheoC  yes i got the same resuls. I wonder if i assign states to each region if that would work. rather than map out the census devision map will be based on states.

 

 

Hi @dokat 

 

Yes, that would work well.  You could then switch from Map visual to Shape / Filled visual and limit it to the US states at a shape level. Add a few little options within the visual menu, and it would look great!

 

Cheers mate! Well done.

 

Theo

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

@TheoC  In theory it works however how will i establish one to many relation. 1 census division may have 6 or 7 states listed under it and i dont have state level sales data. Sales data is at census region level.

I also have DMA data i wonder if there is way to plot based on that rather than US census or divsion data.

Thanks

@dokat 

 

Grab the JSON files for the US census regions, add them to your shape, and you've got exactly what you need:

For US maps:  https://github.com/d3/d3/wiki/gallery/#maps

(original source: https://community.powerbi.com/t5/Desktop/US-states-Shape-Map-JSON-file/m-p/79071)

 

This should resolve the problem 🙂

 

 

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

@TheoC  Thank you for sharing the github link however when i try to download file link broken link and doesnt work. Do you know of any other source that has the files

 

dokat_0-1646114973111.png

dokat_1-1646115060498.png

 

@dokat try this one:

https://github.com/johan/world.geo.json/tree/master/countries/USA

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

@dokat actually, scratch the previous link. Use this one, directly from the US Census site: https://www.census.gov/geographies/mapping-files/time-series/geo/carto-boundary-file.html

 

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

@TheoC thank you for sharing the link from census. How do i incorporate to the shape map?

@dokat check this link out: https://docs.microsoft.com/en-us/power-bi/visuals/desktop-shape-map

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

@TheoC  I am following the instructions in the link. When i download the JSON file from US Census for US Dvisions it is in below format. Non of the flies are in .json format.

 

dokat_0-1646144403536.png

 

@dokat it should be one of the following: https://www.census.gov/geographies/mapping-files/time-series/geo/carto-boundary-file.html

 

Try one of the Nation or Region zips.

 

Cheers

Theo

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

@TheoC I did however none of the files in zip is in .JSON format.

Please see below formats in the zip files.  Thanks

dokat_1-1646144982757.png

 

 

 

dokat_0-1646144895602.png

 

@dokat you may need to convert to JSON: https://www.statsilk.com/maps/convert-esri-shapefile-map-geojso

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

@TheoC I got map to work. I had to convert the data to TopoJson format before importing and use custom map option. My challange right now is state of alaska shows in the map which i'd like to exclude.

 

dokat_0-1646153599953.png

 

@TheoC Thank you i converted the files to GEOJson format and import it to power BI. However when i put it in location it dollars (values) under color saturation it change the map. I put . What may cause this issue? Below is the screenshot

 

dokat_0-1646145844843.png

 

Hi @dokat 

 

A few things can cause this but is likely stemming from a change to excluding Alaska?  The other factor could be the values and their format?  Are you using a measure for the values (i.e. SUM ( Table[Amount] ) or pulling straight from the field pane?  

 

Cheers mate.

Theo 

 

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

@TheoC  I am using a measure not pulling it from field pane. I went back to the original plan, brought in US States Geo Json file into power bi. Created a table with Census Division and States and linked it to the source data.  I have below formula to calculate the average sum for each census divison. It worked for me ut hd to get creative. I couldnt have done without help of @TheoC. Thank you! 

 

POS Sales = var _currentCensus = MAX(Region[Census Division])
var _sum = SUM(Region[Values])
var _uniquestates = CALCULATE(DISTINCTCOUNT(Map[State]),
    Region[Census Division]=_currentCensus)

var _calculation = DIVIDE(_sum,_uniquestates)
return _calculation

 

 

 

dokat_0-1646168301445.png

 

@dokat the map looks sensational mate!  Well done on getting there.  In all honesty, I think you could put together your first blog post on the Community about how you went through this process; a step-by-step guide on this.  Many members of the Community would find it beneficial!!

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

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.

Top Solution Authors