Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Size field in the map visual

Hi, everyone. Help needed, please.

I have 3 columns (Name, Longitue and Lattitude) that are used to plot a regular map visual. I have two groups of data in the name column - Cities and Villages. I would like to use the size field to distinguish between these two groups by making bubbles for all the cities (4 unique Names) of one constant size and other size for all the villages (5 unique Names). What formula should be used in the custom column in Query?

  • Do you already have a column that indicates if that row is a City or Village?  If not, you can generate a Groups column to do that easily.  See this link on how to do that - https://docs.microsoft.com/en-us/power-bi/create-reports/desktop-grouping-and-binning

     

    Once you have that, you can use a measure that returns a size for each city depending on if it is a City or Village.  For example, you could have one like

     

    Bubble Size = IF(MIN(Date[LocationType]) = "City", 10, 5)

     

    This assumes your new column is called LocationType.  You can put that measure in the Size field.  You'll have to play with the 10 and 5 values to get what you want.  

     

    If this works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

    Regards,

    Pat

     

8 Replies

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

    Do you already have a column that indicates if that row is a City or Village?  If not, you can generate a Groups column to do that easily.  See this link on how to do that - https://docs.microsoft.com/en-us/power-bi/create-reports/desktop-grouping-and-binning

     

    Once you have that, you can use a measure that returns a size for each city depending on if it is a City or Village.  For example, you could have one like

     

    Bubble Size = IF(MIN(Date[LocationType]) = "City", 10, 5)

     

    This assumes your new column is called LocationType.  You can put that measure in the Size field.  You'll have to play with the 10 and 5 values to get what you want.  

     

    If this works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

    Regards,

    Pat

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi mahoneypat I don't have one. I only know that top 3 rows are cities and the rest are villages. Can I create an index column and use it instead? 

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

        Easier than an index column would be to make a Groups columns.  See this link - https://docs.microsoft.com/en-us/power-bi/create-reports/desktop-grouping-and-binning.  It's easy and requires no code.  When the wizard dialog opens, click on those first 3, group them, and call that group "City".  Highlight the rest and name that group "Village".  Hit ok, then make a measure like the one I suggested and use it in the Size field well.

         

        If this works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

        Regards,

        Pat

  • add a new calculated column that holds the desired size based on your criteriae.  Then pull that column into the size bucket.

    • parry2k's avatar
      parry2k
      Icon for Super User rankSuper User

      Anonymous I liked mahoneypat solution assuming you have a column to identify city and village.