Forum Discussion
Filled map transparency
Hi
on a filled map i have the issue that the transparency of the colored areas can not be set - it is bold and the map layer is not shining through. I believe it would be helpful to see the unerlaying information (such as city name, borders etc), so is there an option to set the 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
23 Replies
- TomMartensSuper User
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
- AllisonKennedyCommunity ChampionSee if this post helps - the color settings for Filled Maps has been moved to Conditional Formatting
https://docs.microsoft.com/en-us/power-bi/visuals/power-bi-visualization-filled-maps-choropleths- AnonymousNot applicable
thanks for your help - i found this already, strange enough i can't find this 3 dots leading to conditional formatting.
I don't have such 3 dots to click on:
I'm on PBI desktop Version: 2.83.5894.721 64-bit (Juli 2020)
- AllisonKennedyCommunity ChampionAnonymous You have to hover over the Area Name in the right location to get the three dots to appear, and if you have something in Legend you won't have this option, so remove everything from Legend first.
- PaulDBrownCommunity Champion
Anonymous
Unfortunately there are many instances where we cannot set the level of transparency in the formatting options.
I actually posted an idea for implementing transparency levels here:
Transparency settings in colour selection
not much traction unfortunately...
- v-juanli-msftCommunity Support
Hi Anonymous
Thanks very much to TomMartens, your suggestion is brilliant!
Anonymous if you add a column into "Legend" bucket, then it would show color for each category, it is no "conditional formatting" or "fx" for any color.
Remove any column from the "Legend", write measure like TomMartens provided to distinguish different categories.
If it is necessary to add columns in "Legend", please select the lightest color.
Then turn on "data label" on maps, the color is light so it would not hide the data/text on the map.
Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. - AnonymousNot applicable
Thanks for all your help so far - i just wanted to test your suggestions and found something that really confuses me. I loaded the file on another Laptop now it is displayed as i want it. Strange enough.
Difference is in the version:
Original post Version: 2.83.5894.721 64-bit (Juli 2020)
This post Version: 2.83.5894.961 64-bit (Juli 2020)
So let me first check update the version on the other laptop and see if this makes the difference.
- AnonymousNot applicable
Hi Guys,
this drives me absolutly crazy. I opened the file i had on my USB on 2.83.5894.721 it it shows transparancy. I created a new file, loaded the excel sheet with my geocodes and reacreated an new map without any transparency. I compared all setting i could find and can find no difference so far.
My list is very easy - i used for the location field on the filled map the Country and the Postcode area for Germany and Switzerland, the state for Austria (i.e. Deutschland-49 for all Postcodes starting with 49xxx), in the second column i use Sales Manager 1 to 4 to assign them to their sales areas. This works quite well (and is a good workaround for everybody to plot Postcode areas) but why is it in one file transparent, and in the other not? I'd like to share both files (as they do not contain any sensible data yet, it is just a test to plot our sales areas in D and AT) but don't know how.
Any idea?
- TomMartensSuper User
Hey Anonymous ,
to share the files, upload the files to onedrive or dropbox and share the link.
Regards,
Tom