Skip to main content

Power BI

Needs Votes

Set transparency for colors in Power BI

Vote (609) Share
Krishna Sankar's profile image

Krishna Sankar on 10 Aug 2015 09:12:15

Being able to set transparency for Colors. RGBA or equivalent is extremely critical visualization tool. This is very helpful when you want to layer visualizations on top of each other. Ex. Layer an image on top of a text box. Layer different parts of an area chart. Layer a combo chart. This is a basic

Comments (57)
Krishna Sankar's profile image Profile Picture

dcd536a0 4acc-4990-a2f6-b4563d51bec3 on 06 Jul 2020 00:17:27

RE: Set transparency for colors in Power BI

Surely the easiest way is to allow 8 character hex codes

Krishna Sankar's profile image Profile Picture

1ba3f3c5 18b4-4038-b21e-dcd1ff552c4a on 06 Jul 2020 00:16:54

RE: Set transparency for colors in Power BI

But there's no option to choose conditional formatting for chart's Data colors section. I don't see any option to make one of data series transparent.

Only workaround I found is to setup series color the same as background, but grid lines won't be displayed properly.

Krishna Sankar's profile image Profile Picture

7222f29f 9032-4bf8-875e-067bfb17b2b8 on 06 Jul 2020 00:15:08

RE: Set transparency for colors in Power BI

I think it's mostly already there. When formatting a text box or shapes, simply enable Background = On and define both the Fill Color and the Transparency for the selected object.

You can even use any of the CSS-3 color codes (incl. RGBA, HSLA) in combination with conditional formatting and a measure. E.g. for a hardcoded (i.e. unconditional) color create a simple measure like:
SemiTransparentBlue = "RGBA(0,0,255,0.5)"

Then select the [fx] icon next to the color selector, choose Format By = Field Value, and set Based on Field to your (e.g. SemiTransparentBlue).

For real conditional colors your measure should be a bit more advanced though, like:

ConditionalColor =
var _value = [] /* the value to compare */
return
SWITCH( TRUE () ,
_value < -0.1, "RGB(255, 0, 0)",
_value < 0, "lightpink",
_value > 0.1, "HSLA(120, 100%, 75%, 0.5)",
"" /* else (0 >= value <= 0.1) */
)

Note the blank color code as else parameter for full transparency. Very useful for table visuals with alternating white and grey rows when no conditional color should be applied for specific values.

See also: https://docs.microsoft.com/en-us/power-bi/create-reports/desktop-conditional-table-formatting#color-formatting-by-field-value

Still, allowing 8-digit hex codes as in Power app's ColorValue () function would be more user friendly. So I voted too :-)

Krishna Sankar's profile image Profile Picture

254f4aba b4eb-4e31-899d-18f97db54f38 on 06 Jul 2020 00:14:30

RE: Set transparency for colors in Power BI

It will be very useful for Report Design and Data Visualization. !!
Highly recommend to make the report more impactful.

Krishna Sankar's profile image Profile Picture

10df9da6 c24b-492d-8d1b-7d7ac930e4b4 on 06 Jul 2020 00:13:56

RE: Set transparency for colors in Power BI

This would be just awsome!

Krishna Sankar's profile image Profile Picture

0ec63be6 8a4f-47f3-8519-85361c11a6bc on 06 Jul 2020 00:12:41

RE: Set transparency for colors in Power BI

This really impacts the visuals!!!

Krishna Sankar's profile image Profile Picture

6491013a b4d0-4ebd-8cfd-366129074da5 on 06 Jul 2020 00:12:18

RE: Set transparency for colors in Power BI

Need this please - very useful for layering visuals as others have mentioned

Krishna Sankar's profile image Profile Picture

f82c1c4d 883a-4968-96e3-10b9ade90a2d on 06 Jul 2020 00:11:50

RE: Set transparency for colors in Power BI

BUMP. This is important so that you can layer some visuals it should be an easy fix. Just make the option of transparency for basic visuals like bar charts etc.

Krishna Sankar's profile image Profile Picture

05fb8e97 0809-4de0-aac3-355959718b1c on 06 Jul 2020 00:10:39

RE: Set transparency for colors in Power BI

how come this is not possible by now? is this being watched by MS?

Krishna Sankar's profile image Profile Picture

be9de6f2 b570-45d8-95eb-33784b195923 on 06 Jul 2020 00:09:18

RE: Set transparency for colors in Power BI

How is this not possible by now? :O