Deep dive into the Shape Map in Power BI (Generally Available)

With Shape Map (Generally Available) in Power BI, you can display data on any shape you can define—countries, regions, or other geographical boundaries—and color each area based on your data to quickly spot patterns and compare values.

 

Whether you’re analyzing sales across geographic territories or comparing performance across franchise locations, Shape Map lets you visualize data on maps that match your actual business boundaries rather than standard administrative regions. Define your own map boundaries using TopoJSON or GeoJSON files.

Three ways to add maps

Built-in maps

Choose from ready-to-use maps for common regions: US states, Canadian provinces, Australian states and territories, German states, French regions, and more.

Upload custom maps

Upload your own TopoJSON or GeoJSON file for boundaries not available in the built-in options—sales territories, judicial districts, or any other regions specific to your organization.

Reference maps via URL

Point to a map file hosted online. This is useful for sharing a single map across multiple reports or managing maps in a central location. Use the Fx button to reference a measure containing the URL for dynamic map selection.

Download and edit your custom maps

Shape Map lets you download a previously uploaded custom map directly from the visual. Select the Shape Map, open Map settings in the Format pane, and select Download map. Edit the file as needed, then upload the updated version.

TopoJSON and GeoJSON support

Shape Map works with two standard map formats:

  • TopoJSON encodes topology, storing shared boundaries only once. This typically results in smaller file sizes.
  • GeoJSON is an open standard format widely supported by mapping tools.

Both formats work equally well. Use whichever format your tools produce or that best fits your file size requirements.

Map projections

Shape Map includes projection options that control how the three-dimensional earth displays as a two-dimensional map:

  • Albers USA: A conic projection optimized for the United States that minimizes distortion across the continental US, Alaska, and Hawaii.
  • Equirectangular: A cylindrical projection that converts the globe into a grid with each rectangular cell having the same size, shape, and area.
  • Mercator: A cylindrical projection with the equator as the line of tangency. Polar areas appear more distorted than with Equirectangular.
  • Orthographic: A projection from an infinite point, as if viewing from deep space. This gives the illusion of a three-dimensional globe.

Select the projection that best fits your map’s geographic coverage and the visual effect you want to achieve.

Color formatting options

The Colors section in the Format pane adapts based on how you configure the visual:

  • Location only: The most flexible option. Use conditional formatting to color regions by gradient, rules, or field value—or set colors manually for each region.
  • Location and Legend: When you add a categorical field to the Legend well, set a static color for each category.
  • Color saturation: When you add a numeric field to Color saturation, the visual applies a gradient based on that field’s values.

The Format pane shows only the relevant options based on your current configuration, making it easier to find the settings you need.

 

You can also set a color for regions that don’t map to a value in your data. Use this to distinguish unmapped areas or set them to match the background to create holes in the map.

Use cases

Regional breakdowns with Location and Legend

Display your organization’s region groupings by adding a Region field to the Legend well. Each region gets a static color—for example, color US states by sales region (Northwest, Northeast, Southeast, Southwest) to show territory boundaries at a glance.

 

DataZoe_0-1782800431248.png

Figure: US states grouped by sales region using the Location and Legend wells, with each region assigned a static color.

Sales by region with Location only

Use conditional formatting with a DAX measure to create a gradient effect within each region.

 

DataZoe_1-1782800448686.png

Figure: US states colored with conditional formatting, where each state’s shade reflects sales relative to other states in the same region.

 

The following measure calculates a hex color based on Total Sales, with each region using its own color palette:

Region Gradient Color =
VAR ScaleWithinRegion = TRUE
VAR CurrentSales = [Total Sales]

VAR ScopeMin =
    IF (
        ScaleWithinRegion,
        CALCULATE (
            MINX ( VALUES ( StateRegion[StateName] ), [Total Sales] ),
            ALLEXCEPT ( StateRegion, StateRegion[Region] )
        ),
        CALCULATE (
            MINX ( VALUES ( StateRegion[StateName] ), [Total Sales] ),
            ALL ( StateRegion )
        )
    )

VAR ScopeMax =
    IF (
        ScaleWithinRegion,
        CALCULATE (
            MAXX ( VALUES ( StateRegion[StateName] ), [Total Sales] ),
            ALLEXCEPT ( StateRegion, StateRegion[Region] )
        ),
        CALCULATE (
            MAXX ( VALUES ( StateRegion[StateName] ), [Total Sales] ),
            ALL ( StateRegion )
        )
    )

VAR Ratio =
    DIVIDE ( CurrentSales - ScopeMin, ScopeMax - ScopeMin )

VAR Region = SELECTEDVALUE ( StateRegion[Region] )

VAR EndR = SWITCH ( Region,
    "Northwest", 17,  "Northeast", 216, "Southeast", 116,
    "Southwest", 224, "Alaska", 17,     "Hawaii", 17,    128 )
VAR EndG = SWITCH ( Region,
    "Northwest", 141, "Northeast", 106, "Southeast", 78,
    "Southwest", 68,  "Alaska", 141,    "Hawaii", 141,   128 )
VAR EndB = SWITCH ( Region,
    "Northwest", 255, "Northeast", 44,  "Southeast", 194,
    "Southwest", 68,  "Alaska", 255,    "Hawaii", 255,   128 )

VAR TintStrength = 0.15
VAR StartR = 255 - ( 255 - EndR ) * TintStrength
VAR StartG = 255 - ( 255 - EndG ) * TintStrength
VAR StartB = 255 - ( 255 - EndB ) * TintStrength

VAR R01 = MIN ( 1, MAX ( 0, Ratio ) )

VAR R = INT ( StartR + ( EndR - StartR ) * R01 )
VAR G = INT ( StartG + ( EndG - StartG ) * R01 )
VAR B = INT ( StartB + ( EndB - StartB ) * R01 )

VAR HexChars = "0123456789ABCDEF"
VAR Hex =
    "#" &
    MID ( HexChars, QUOTIENT ( R, 16 ) + 1, 1 ) & MID ( HexChars, MOD ( R, 16 ) + 1, 1 ) &
    MID ( HexChars, QUOTIENT ( G, 16 ) + 1, 1 ) & MID ( HexChars, MOD ( G, 16 ) + 1, 1 ) &
    MID ( HexChars, QUOTIENT ( B, 16 ) + 1, 1 ) & MID ( HexChars, MOD ( B, 16 ) + 1, 1 )

RETURN
    IF ( ISBLANK ( CurrentSales ), "#FFFFFF", Hex )

Set the conditional formatting to Field value and select this measure. Each state shows a color intensity based on its sales relative to other states in the same region.

Store coverage with Color saturation

Add a store count measure to the Color saturation well to show where you have stores and how many. States with more stores appear darker, while states with fewer stores appear lighter.

 

DataZoe_2-1782800502316.png

Figure: US states shaded by store coverage using Color saturation, with darker colors indicating higher store counts and blank areas showing states with no stores.

 

States with no stores show as blank areas—choose to display them to highlight gaps in coverage or hide them to focus only on states where you operate.

 

DataZoe_3-1782800517792.png

Figure: US states with store coverage shown using Color saturation, with blank areas turned off so only states with store data appear.

Comments

Popular posts from this blog

Exception deserializing the package "The process cannot access the file because it is being used by another process."

SSRS INTERVIEW QUESTIONS

Failed to execute the package or element. Build errors were encountered