Forum Discussion

microsoftrookie's avatar
microsoftrookie
Advocate II
9 years ago
Solved

Geography Layers

Hello, I am new to Microsoft Power Bi and i am trying to get a filled map to represent both the data for the United States nation and a singular state. My data contains both United States data and (i.e.) New Jersey data. I have tried putting in (new jersey, new jersey), (united stares of america, new jersey, united states of america). When i select geography types in the data format power bi only seems to accept one of them (county/region, place, Country). For example the united states will be filled in, but once a filter is selected then for new jersey it won't highlight it. Is there a way to get both on the same map and highlight each one while selected?

  • Anonymous's avatar
    Anonymous
    9 years ago

    Hi microsoftrookie,

    You get an expected behavior in filled map. As your post, we are only able to select the geography column as either a state or a country. When you label geography column as country, how does Power BI recognize New Jersey as a country since it is a state? And vice versa.

    In your scenario, if you persist to use filled map, you would need to separate data of  New Jersey and United States into different tables, then create two filled maps.

    However, if you don’t want to separate data of  New Jersey and United States into different tables, then you can add Latitude and Longitude columns in your current table, and create a map visual instead of filled map using Latitude, Longitude columns and numerical data columns. This way, when you create a slicer using geography column, you can highlight proper section in map visual when selecting value in the slicer.

    Thanks,
    Lydia Zhang

6 Replies

    • microsoftrookie's avatar
      microsoftrookie
      Advocate II

      Sure thing.

      I do not know if I did this correctly, however I need to be able to display both United States and New Jersey as their own seperate entities. The first picture is a sample of some numerical data that we used for the nation, and the nation data is in the same column as a state's data.  The next picture is how the geographies are listed in the same column in the queries. For example, pie charts and graphs are able to both of these geographies numerical data well. I need to be able to represent the nation as highlighted in the third picture, but when a slicer is selected like in the 5th picture, I need it to highlight just the state as it is in the 4th picture. However, currently I can only select my geography column as either a state or a country, and will only pick up on highlighting one and returning the final map, as shown with nothing filled in. So, if the column is labeled at country, and I select a New Jersey slicer will not highlight new jersey, but if I select United States it has been returning the filled Country map like in picture 3, and vice versa.

    • microsoftrookie's avatar
      microsoftrookie
      Advocate II

      Sure thing.

      I do not know if I did this correctly, however I need to be able to display both United States and New Jersey as their own seperate entities. The first picture is a sample of some numerical data that we used for the nation, and the nation data is in the same column as a state's data.  The next picture is how the geographies are listed in the same column in the queries. For example, pie charts and graphs are able to both of these geographies numerical data well. I need to be able to represent the nation as highlighted in the third picture, but when a slicer is selected like in the 5th picture, I need it to highlight just the state as it is in the 4th picture. However, currently I can only select my geography column as either a state or a country, and will only pick up on highlighting one and returning the final map, as shown with nothing filled in. So, if the column is labeled at country, and I select a New Jersey slicer will not highlight new jersey, but if I select United States it has been returning the filled Country map like in picture 3, and vice versa.

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi microsoftrookie,

        You get an expected behavior in filled map. As your post, we are only able to select the geography column as either a state or a country. When you label geography column as country, how does Power BI recognize New Jersey as a country since it is a state? And vice versa.

        In your scenario, if you persist to use filled map, you would need to separate data of  New Jersey and United States into different tables, then create two filled maps.

        However, if you don’t want to separate data of  New Jersey and United States into different tables, then you can add Latitude and Longitude columns in your current table, and create a map visual instead of filled map using Latitude, Longitude columns and numerical data columns. This way, when you create a slicer using geography column, you can highlight proper section in map visual when selecting value in the slicer.

        Thanks,
        Lydia Zhang