Skip to content

Instantly share code, notes, and snippets.

@ninmonkey
Last active May 29, 2022 18:06
Show Gist options
  • Select an option

  • Save ninmonkey/05d4f3eda3afd9b72363b426c9dbe27b to your computer and use it in GitHub Desktop.

Select an option

Save ninmonkey/05d4f3eda3afd9b72363b426c9dbe27b to your computer and use it in GitHub Desktop.
DynamicColors-UsingMeasures-PowerBI.md

Colors in Power BI

Static

[ Static Alpha Hsla ] :=
    "hsla(219, 68%, 20%, 0.5)"
[ Static Alpha RGBA ] := 
    "#9999993f" 
[ Static RGBA ] :=
    "rgba(128, 128, 128, 20)"

One variable / Axis

[ Color HSL ] :=
    VAR _alpha = SELECTEDVALUE(Color[Alpha])

    return "hsla(219, 68%, 20%," & _alpha & ")"
[ Alpha As Dec ] :=
    int( SELECTEDVALUE( Color[Alpha]) * 256  )
VAR _alpha =  int( 255 * SELECTEDVALUE( Color[Alpha] , 0))
Var _red =   127
Var _green = 110
Var _blue = 200

var _final = 
    "rgba(" & _red & "," & _green & "," & _blue & "," & _alpha & ")"


return _final
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment