Forum Discussion
Filled map transparency
- Anonymous6 years ago
AllisonKennedy TomMartens i spotted the issue now. I unpacked the pbix file and checked the differences of the layout file and found that i use different designs. When i changed the Design on the solid file from "Standard" to "Classic" and BOOOOM. Thats it. Also some other designs work, some not. I could not spot a setting in the design to influence it, but this does not matter. If i have time i may look into the json for the designs to see what parameter influences it.
Thanks for you help, really appreciated - sometimes you overlook the obvious
Hey Anonymous ,
if this is what you are looking for:
It can be achieved even if it's a bit hacky.
Let's assume my data looks like this:
I create a measure that simply calculates the amount percentage per country using this measure:
share =
IF(
HASONEFILTER('Some Country'[Country])
, var _country = MAXX(VALUES('Some Country'[Country]) , 'Some Country'[Country])
var allAmount = CALCULATE(SUM('Some Country'[Amount]) , ALL('Some Country'[Country]))
return
DIVIDE(SUM('Some Country'[Amount]) , allAmount)
, BLANK()
)
And a 2nd measure that I call DIYgradient like so:
DIYgradient =
var basecolor = "#009dff"
var simpleColorgradient = RIGHT(CONCATENATE("0" , INT([share] * 100)) , 2)
return
CONCATENATE(
basecolor
, simpleColorgradient
)
This measure concatenates the hexcode of a color with a 2 digit number representing the percentage of a country, this percentage represents the level of transparency. If a color is represented by 8 characters instead of 6. The last 2 numeric characters are representing the percentage of transparency (numeric characters are mandatory otherwise the hexcode does not represent a valid color).
Please be aware that following the next steps can not be undone, if you are not satisfied with the outcome, you have to delete the Filled map visual and restart with a new Filled map visual. I consider this a bug, but nevertheless I use this to add transparency to the filled polygons in production deployments of my Power BI reports
.
Now you can add the measure DIYgradient to the Data colors property of the map using the conditional function sign:
Make sure you choose this rule
Hopefully, this provides what you are looking for.
Regards,
Tom