Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Map Visualizations; Moving from Location Field to Latitude/Longitude fields.

Hello,

 

I'm attempting to plot over 100 locations worldwide, I really like creating a geographic hierarchy so that I can get an overview by country -> State -> Address. Some of our locations have multiple "places" that Bing Maps technically classifies as 1 address. I want to be able to drill down to that precision, which I know I can do with Lat/Long, but then I lose the ability to use the location hierarchy.

 

Example: In the US I have 50 "Facilities", in California I have 25 of them, and in 1 address we have 8 different facilities. I want to be able to in a map dashboard report all of the US, All of California, All of that address, and then everything inside that address.

 

I'm hoping someone has figured out how to do this.

 

Thanks in advance,

 

  • Anonymous's avatar
    Anonymous
    6 years ago

    That's a neat way of thinking about it, I'm sure that could be applied elsewhere too.

     

    I did figure out a work around that fits perfectly for my issue.

     

    Incase anyone else comes across this topic, If you combined your Latitude & Longitude columns into one column, with a comma between the values, PowerBI will let you put it in the location field. This way you can fit it into your geographic hierarchy.

     

    Cheers,

5 Replies

  • v-lili6-msft's avatar
    v-lili6-msft
    Icon for Community Support rankCommunity Support

    HI  Anonymous 

    For your case, you'd better add a category field (or other field like 'primary key') for each address, then darg it into Legend Value of map visual.

    For example:

    Add a column like group rank

    Category =
    RANKX (
        FILTER (
            'Table',
            [Country] = EARLIER ( [Country] )
                && [State] = EARLIER ( [State] )
                && [Address] = EARLIER ( [Address] )
        ),
        [Value]
    )

    Then drag it into Legend Values of Map visual

     

     

    Regards,

    Lin

    • Anonymous's avatar
      Anonymous
      Not applicable

      That's a neat way of thinking about it, I'm sure that could be applied elsewhere too.

       

      I did figure out a work around that fits perfectly for my issue.

       

      Incase anyone else comes across this topic, If you combined your Latitude & Longitude columns into one column, with a comma between the values, PowerBI will let you put it in the location field. This way you can fit it into your geographic hierarchy.

       

      Cheers,

      • maibacher's avatar
        maibacher
        Icon for Microsoft Employee rankMicrosoft Employee

        Anonymous 

        Hello David, I'm going through exactly the same issue but I'm unclear about your explanation.

         

        I started with a geographic hierarchy: country > state > city, etc, but ended up with tons of data points that are mapped to the wrong locations, meaning I could spend countless hours cleaning them all up, or else I could just implement my latitude and longitude columns that I've had handy this whole time.

         

        You're right, you lose the ability to drill through the hierarchy, if you opt for lat/long. With Lat and Long entered into their individual respective fields, I try to add Country to the Location field. My visual immediately crashes and gives the following message which I just can't find an explanation to on the web.

         

        "Remove Location to display latitude and longitude pairs. Alternatively, you can also keep Location and set the aggregate for Latitude and Longitude to Average." Without a clear explanation for this, I defer to the method you instructed. But I'm unclear there too...

         

        When you say you combined the two columns into one, you actually created a new column such as LatLong = Latitude&", "&Longitude? And what are your data category and default summarization set to? What do I need to know so that I can drop Lat and Long into the Location field, along with the geographical hierarchy from before?

         

        Thanks!