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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Adding a 2nd Latitude and Longitude to the Map Visual

Hello,

 

I am wanting to create a map visual similar to this;

sltraffic_0-1607618365534.png

The Incidents and Crashes values are included in the same column so I have duplicated the primary Query (eventsList) and filtered the values that make up the 'Incidents' and 'Crashes' into separate Queries (eventsLists (Incidents), eventsList (Crashes), respectively).

sltraffic_1-1607618546997.png

In the available Map Visual it appears I am only able to add Lat/Long for one dataset (eventsList (Incidents) shown below). How can I add the 2nd dataset to the same Map Visual and assign it a different color?

sltraffic_5-1607619066954.png

 

sltraffic_4-1607618787533.png

 

 

 

1 ACCEPTED SOLUTION

Hi @Anonymous ,

 

In the query editor add a new column with the following syntax:

 

if 

[Column1]  = "accident" 
or [Column1]  = "minor accident"
or [Column1]  = "multi vehicle accident"

then "Crash" else 

if 
[Column1]  = "stalled vehicle" 
or [Column1]  = "debris in roadway"
or [Column1]  = "incident"
then 
"Incident"
else

"NO CATEGORY"

Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

7 REPLIES 7
BakeKhandakar15
New Member

How to Get 2nd Latlong/ what is the 2nd Latlong

Anonymous
Not applicable

Thank you for the suggestions...it worked exactly how it was supposed to!

Anonymous
Not applicable

Ok, that makes sense. Since I'm quite new to Power BI, any suggestions as to how I would classify each entry as a 'Crash' if it has originally been assigned an 'accident', 'minor accident', 'multi vehicle accident' or 'Incident' if it has originally been assigned a 'stalled vehicle', 'debris in roadway', or 'incident'? Here is an example of my table;

sltraffic_0-1607971825416.png

 

Hi @Anonymous ,

 

In the query editor add a new column with the following syntax:

 

if 

[Column1]  = "accident" 
or [Column1]  = "minor accident"
or [Column1]  = "multi vehicle accident"

then "Crash" else 

if 
[Column1]  = "stalled vehicle" 
or [Column1]  = "debris in roadway"
or [Column1]  = "incident"
then 
"Incident"
else

"NO CATEGORY"

Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



Icey
Community Support
Community Support

Hi @Anonymous ,

 

You can create a calculated column in your table like so:

 

Crash or Incident =
SWITCH (
    TRUE (),
    [Column] IN { "accident", "minor accident", "multi vehicle accident" }, "Crash",
    [Column] IN { "stalled vehicle", "debris in roadway", "incident" }
)

 

 

Then, you can create a slicer using this column to filter data.

 

 

Best regards

Icey

 

If this post helps, then consider Accepting it as the solution to help other members find it faster.

Hi @Anonymous ,

 

How did you do the split of the table into two different tables?

 

Did you filter put any field by some categoruzatipn?


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



MFelix
Super User
Super User

Hi @Anonymous,

 

Has you refer you can only add a single LATITUDE and LONGITUDE believe that since this two table are a from the same table you don't need to split the data into two tables, just use an additional column on your data to categorized the information into crashes and incidents and then use that column on the Legend of the map that way you have more than one spot on the same map:

 

MFelix_0-1607965877920.png

 


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors