set_conditional_formatting
Apply discrete background color bands to measure columns in Power BI tables/matrices. Set rule-based conditions to color each value based on min/max ranges.
Instructions
Apply DISCRETE rule-based BACKGROUND colour bands to a measure column in a table/matrix: each value in [min, max) renders its band colour. rules = JSON array of {min, max, color} (e.g. positive band #C6EFCE, negative band #e68f96). Writes the standard Power BI rule-based conditional-formatting structure (RuleDefinition rules with a >=min AND <max condition per band), NOT a gradient. For a smooth colour scale instead, use set_color_scale.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page | Yes | page name or displayName | |
| rules | Yes | JSON array of {min, max, color} bands | |
| visual | Yes | table/matrix visual name | |
| measure | Yes | measure that drives the colour | |
| objectName | No | formatting object (default values for table/matrix) | values |
| measureTable | Yes | table that owns the measure | |
| propertyName | No | formatting property (default backColor) | backColor |
| reportSessionId | Yes |