A set of 3 UDFs to function as tokens bases for measures that can switch between light and dark mode for use in conditional formatting fields.
The purpose of this is to facilitate the creation and integration of design systems inside of PowerBI through using measures as tokens for all conditional formatting fields. If you plan ahead to leverage visuals and account for the use of the entire color system inside of measures it can get you pretty far.
Warning
If you intend to implement a design system through these means you need to be aware that it's going to be as much of a bonus as a hindrance as a lot of native visuals don't support conditional formatting nowhere near the levels they should.
- Arekchr.Tokens.ColumnBased - Generates a HEX color token based on columns if your design system exists in a table that's tied to the Arekchr.ThemeSwitch table (Measure)
- Arekchr.Tokens.Default - Generates a HEX color token based on HEX scalar inputs that's tied to the Arekchr.ThemeSwitch table (Measure)
- Arekchr.Tokens.ThemeSwitch - Generates a table that allows the end user to switch between Light and Dark mode.
PowerBI DataViz World Championship Feb 25 Judges' Favourite example using these (pre-UDF version but if anything it's easier now and has already been tested.)