15. Maps: Showing Maharashtra on a Map
15.3 Data Categories and Geocoding
Start with a problem
Shahrukh's map puts a bubble for Aurangabad in the wrong place and ignores Sambhaji Nagar written in two spellings.
Explain simply
Data category tells Power BI what a column means (City, State, Country, Postal code, Latitude, Longitude). Geocoding turns those names into map positions. Clear categories and full names give correct positions.
Show the data
| City (raw) | Problem | Fix |
|---|---|---|
| Aurangabad | Old name; ambiguous worldwide | Standardise to Sambhaji Nagar (Module 7.9) |
| Chh. Sambhajinagar | Spelling variant | Map to one spelling |
| Pune | Could match another Pune | Add State and Country |
About this data: This table uses columns: City (raw), Problem, Fix. This table uses columns: City, Bubble location. This table uses columns: Wrong result, Reason, Correction. Values shown are the lesson examples already on this page (not a new dataset).
Fictional sample data. Practice file: visuals_orders_apr_may_2026.csv, dark_stores_maharashtra.csv (source: src/practice/).
Demonstrate
- Select
Cityin the Data pane › Column tools › Data category › City. - Add a column
Place = [City] & ", Maharashtra, India"in Power Query or DAX. - Set
PlaceData category to Place (or use City + State + Country in Location). - Use
Placein the map's Location well.
Show the result
Your result should look like this (fictional sample):
| City | Bubble location |
|---|---|
| Pune, Maharashtra, India | Pune (correct) |
| Nashik, Maharashtra, India | Nashik (correct) |
| Kolhapur, Maharashtra, India | Kolhapur (correct) |
Explain what happened
Adding state and country removes ambiguity, so the map service returns the Maharashtra match first.
Explore further
- Latitude/Longitude (15.4) avoids geocoding completely.
Detailed reference for this lesson:
Power BI converts text into coordinates (geocoding) using an online service. A plain "Aurangabad" or "Nagpur" might be matched to a place with the same name elsewhere. Tell Power BI what each column means with a data category.
Steps in Power BI
- In Table view or the Data pane, select DarkStore › City.
- Column tools › Data category › City.
- Set State › State or Province, Country › Country/Region, Pincode (Text) › Postal code, Latitude › Latitude, Longitude › Longitude.
- A globe icon appears next to geo-categorised fields in the Data pane.
Other data categories: Address, Continent, County, Place, Web URL, Image URL, Barcode.
Avoid wrong geocoding with a full location column:
Map Location = DarkStore[City] & ", " & DarkStore[State] & ", " & DarkStore[Country]
-- "Sambhaji Nagar, Maharashtra, India"
Store Address = DarkStore[Area] & ", " & DarkStore[City] & ", Maharashtra, India"
-- "Tarabai Park, Kolhapur, Maharashtra, India"
Set Map Location to data category Place (or Address for Store Address) and use it in the map's Location well. You can also build it in Power Query with Merge Columns (Module 7.11).
Got it? "Nagpur, Maharashtra, India" is safer than just "Nagpur". If not, look at the example again.
समजलं का? नुसत्या "Nagpur" पेक्षा "Nagpur, Maharashtra, India" जास्त safe आहे. नसेल समजलं तर उदाहरण पुन्हा बघा.
समझ आया? सिर्फ़ "Nagpur" से "Nagpur, Maharashtra, India" ज़्यादा safe है. नहीं समझा तो उदाहरण फिर से देखिए.
Ravindra Bagale's Tip
Look, friends: plotting "Nagpur" or "Sambhaji Nagar" without the state can drop the bubble in the wrong place, and renamed places may not be recognised yet. Set the data category, build a full location like "Nagpur, Maharashtra, India", and keep Pincode as Text with the category Postal code. If a bubble still lands wrong, switch to latitude and longitude. Don't make this mistake!
Ravindra Bagale's Tip – मराठी
हे बघा मित्रांनो: state शिवाय "Nagpur" किंवा "Sambhaji Nagar" plot केलं तर bubble चुकीच्या ठिकाणी पडू शकतो, आणि नाव बदललेली ठिकाणं अजून ओळखली जात नसतील. Data category set करा, "Nagpur, Maharashtra, India" सारखं पूर्ण location बनवा, आणि Pincode Postal code category सोबत Text म्हणून ठेवा. तरीही bubble चुकीच्या जागी पडला तर latitude आणि longitude वापरा. ही चूक करू नका!
Ravindra Bagale's Tip – हिंदी
देखो दोस्तों: state के बिना "Nagpur" या "Sambhaji Nagar" plot करने पर bubble गलत जगह गिर सकता है, और नाम बदली जगहें शायद अभी पहचानी न जाएँ. Data category set करो, "Nagpur, Maharashtra, India" जैसी पूरी location बनाओ, और Pincode को Postal code category के साथ Text रखो. फिर भी bubble गलत जगह गिरे तो latitude और longitude पर जाओ. यह गलती मत करना!
Fix common mistakes
| Wrong result | Reason | Correction |
|---|---|---|
| Bubble in another country | Ambiguous name | Add State and Country, or use coordinates |
| Two bubbles for one city | Spelling variants | Standardise spellings in Power Query |
| Category set but no change | Visual uses a different column | Use the categorised column in Location |
Practise independently
Practice task
Write the Place value you would build for Kolhapur.
Hints
- City, state, country.
Solution
"Kolhapur, Maharashtra, India" with Data category Place (or City + State + Country fields).
Think like a professional
Geocoding errors are silent – the map still looks fine. Always check one or two bubbles against known locations before publishing.
Revision card
Interview card