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
Gracie
Helper II
Helper II

Have errors when use average long and lat on map

Hi~ I want to made a map visual that shows the best sold product in each ZIP code and display the product name as label on map. Below is the sample of my data. Each ZIP cod is distinct. 

 

ZipMappedMost Sold ProductLatitudeLongitudeTotal UnitsState
10030A40.81847-73.94331NY
10705B40.92654-73.87253NY
14025D42.62539-78.72684NY
19320E39.96886-75.82921PA
20190F38.96146-77.34186VA
20720A38.98851-76.7912MD
21787B39.65745-77.16915MD
22406C38.41436-77.53477VA
23221D37.5532-77.48971VA
27530E35.36828-78.09292NC
27889F35.51927-76.88921NC
28304F35.02063-78.990910NC
28538Z35.42196-77.591212NC
29566D33.81647-78.7584SC
30017A,B,C33.91692-84.0412GA
30075D,E34.0552-84.37055GA
34208F27.46782-82.51210FL

 

 

The error I have is that after I put Most Sold Product in Location, Latitude in Latitude, Longitude in Longitude, and then click the longitude and latitude to average. I found that the ZIP code's location on the map is wrong.  Below is the map I used the above data.  For example, the tooltip show the Florida point, but it shows in South Carolina. The Longitude and latitude is different too. How can I sove this problem?? Thanks!

 

Untitled.png

1 ACCEPTED SOLUTION

Ok then what I would suggest is to rather remove the item from location.


Put your Product Name in the Legend Area.

 

And then leave the Lat and Long as the values that they are.

 

Then if you use the State as a Slicer you will be able to see the purchases in each state.


Then if you wanted to see who was the Max or Min, you could create a table with all the relevant details. The table will filter based on what you select in the slicer. As well as in the table you can then change the order by clicking on the column value (which will enable the table to sort by largest purchase)





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!







Power BI Blog

View solution in original post

6 REPLIES 6
GilbertQ
Super User
Super User

Hi @Gracie

 

I took your data and imported it.

What I then did was I went to the Modeling tab and under the Properties changed the Data Category to Latitude for Latitude as well as Longitude with Longitude. I also changed the Default Summarization from Sum to Don't Summarize as shown below.

 

A-PBI Community.png

I then created the Map and put in the Lat and Long and then filtered to FL and this looks correct based on your data.

A-PBI Community.png

 

It would appear that possibly the Lat and Long properties were not set for the mapping?





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!







Power BI Blog

Thank you. But I want the most sold product in the location field so that when I display the label, it will show on the map like the picture below. However, in order to do that, I have to use average of longitude or latitude which will cause wrong location on the map. Do you know how can I make sure the right location as well as label display?

 

Capture.PNG

Go to query editor and change Lat and Long to text data type  and save and close .. In power BI desktop go to modeling tab and  change Lat to Lat and Long to Long under data category also make them Don't summarize , then place the fields in the respective tabs , Now you will see them as first lat and first long click on the down arrow button and make it to Don't summarize then you will see the correct lat and long in the visulazation.. 

 

Hope this will help you..

Just so I understand correctly you are wanting to map the most products sold in a particular region?




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!







Power BI Blog

Yes. I want to show the product name as label in the map.

Ok then what I would suggest is to rather remove the item from location.


Put your Product Name in the Legend Area.

 

And then leave the Lat and Long as the values that they are.

 

Then if you use the State as a Slicer you will be able to see the purchases in each state.


Then if you wanted to see who was the Max or Min, you could create a table with all the relevant details. The table will filter based on what you select in the slicer. As well as in the table you can then change the order by clicking on the column value (which will enable the table to sort by largest purchase)





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!







Power BI Blog

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.