mapboxgl-powerbi icon indicating copy to clipboard operation
mapboxgl-powerbi copied to clipboard

Add support for color-based bivariate choropleth

Open otravers opened this issue 5 years ago • 4 comments

After some trial and error I've come to the conclusion that extrusion (as per https://github.com/mapbox/mapboxgl-powerbi/issues/188) works really well to create 3D maps at a relatively small scale with few map sections, typically the neighborhoods of a city. However things become quickly unreadable and a 3D choropleth of say, the US by state, let alone by county, is just unreadable.

I suggest adding the possibility of putting two variables in the Color field of choropleth maps, which allows the creation of legible maps like this: image

Prior art:

In the absence of native support, I believe this could be done manually with some DAX magic and a separate legend in a matrix using conditional formatting. I'll give it a try and post here if I get something conclusive.

otravers avatar Jul 23 '19 14:07 otravers

As I suspected all it takes is 1) a few nested switch statements in DAX to determine the right color, and 2) support for expression-based coloring in the map visual, as illustrated below with the default Map visual using the "Format by field value" option:

image

TLDR: if Mapbox implements https://github.com/mapbox/mapboxgl-powerbi/issues/266 then it will be possible to create bivariate choropleth with a bit of conditional DAX (leaving aside how to render the two-axes legend).

otravers avatar Jul 23 '19 18:07 otravers

cc/ @samgehret

ryanbaumann avatar Jul 23 '19 19:07 ryanbaumann

Any updates on this issue?

mustaqilmulazim avatar Sep 16 '21 19:09 mustaqilmulazim

Same! This feature and a simple demo example will be extremely helpful!

xiaofanliang avatar Oct 24 '21 20:10 xiaofanliang