Colors and legend → By expression, e.g. If(Sum(Sales) < 0, Red(), Green())
Color by expression in Power BI
Qlik colours chart elements with an expression that returns a colour. Power BI does the same with conditional formatting using "Field value": a measure returns a hex code or colour name.
Short answer: Write a measure that returns text such as "#C00000", then in the visual's colour setting click fx → Format style Field value → pick the measure. Rules and gradients work without DAX for simple cases.
What it does in Qlik
Qlik's colour expression runs per data point and returns RGB(), ARGB(), a named colour such as Red(), or a hex string.
Qlik example
If(Sum(Sales) < Sum(Target), RGB(192,0,0),
If(Sum(Sales) < Sum(Target) * 1.1, RGB(255,192,0), RGB(0,176,80)))Power BI equivalent
Colour measure
Sales colour =
SWITCH (
TRUE (),
[Sales] < [Target], "#C00000",
[Sales] < [Target] * 1.1, "#FFC000",
"#00B050"
)Bar chart: Format → Bars → Color → fx. Table: right-click the field in the Values well → Conditional formatting → Background color (or Font color) → Field value.
Gotchas and behaviour differences
- In Power BI the measure must return a string (hex
#RRGGBB,rgb(...)text, or a CSS colour name). There are noRGB()orRed()functions in DAX. - Some visuals only allow conditional colours when there is no legend field, and some custom visuals don't support them. Check the visual before redesigning.
- Qlik's "persistent colours" for dimension values have no direct counterpart. Keep colours stable with a colour column on the dimension table and conditional formatting on it, or set data colours manually.
Official documentation
- Coloring by expression (Qlik Help)
- Apply conditional table formatting in Power BI (Microsoft Learn)
Related pages
If(cond, then, else)
If and nested If
Qlik's If() maps directly to DAX IF and to Power Query's if ... then ... else. Long nested Ifs are cleaner as SWITCH(TRUE(), ...). Qlik's numeric booleans (-1/0) are the main difference.
Direct equivalent
Master items: reusable dimensions, measures and visualizations
Master items (master dimensions and measures)
Qlik master items are governed, reusable expressions stored in the app. In Power BI the equivalent is a measure in the semantic model. Every measure is reusable by default. To share across reports, publish one semantic model and build thin reports on it.
Partial / different approach
Spotted an error or a better pattern? QlikToDax is maintained by a working BI consultant; corrections are welcome via the About page. Last reviewed 2026-10-25.