'PowerBI Map visuals with two different tables of Latitude and Longitudes. How would I use IF statements or any other conditional arguments?

So I have two different tables that has two different facility types. Each table contains columns of both latitude and longitude.

Sometimes those two types of facility is coordinated in the approx. same lat and long, ALTHOUGH the Coordinate is NOT exactly the same.e.g. (29.76,-47.29) (29.75 ,-47.31)

Since Power BI map visuals is not possible to show two different tables, I have appended both tables. and those will give null value for each type of facility names.

What I want to portray in the map visual is that we divide the legends by three different types, 'Type A' in First table, 'Type B' in Second Table and 'Combined' that has combined facility type with approx same latitude and longitude(Inclusive). So Appended tables has overlapping facilities with approx. same lat and long.

My approach is to create a column using conditional statements in power query where we subtract each lat and long.

And if we get the value lower than 0.02 for each subtraction value we would get 'Combined' and categorize Type A and B for each specific ID,

= Table.AddColumn(#"Reordered Columns", "Facilitytype", each if [Latitude]-[Latitude] AND [Longitude]-[Longitude] <= 0.02 then "Combined" else if [Nameid]= % then "Type A" else "Type B")

I know there must be wrong parts with my codes and Syntax error there but I am stuck with how to solve this problem.

Thanks!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source