Forum Discussion
Conditional formatting for category axis labels based on Budget vs Actual
- 2 months ago
Hi mahendrakanouji - No, this is not natively supported in Power BI's clustered bar chart.
Ref: Create and use column charts in Power BI - Power BI | Microsoft Learn
Suggest: Color the bars instead apply conditional formatting to the bar data colors using a DAX measure like: eg: Bar Color =
IF([Budget] > [Actual], "green", "red")or try with Deneb custom visual (advanced)
Hope this helps.
- 2 months ago
Hi mahendrakanouji,
Just want to let you know that category label conditional formatting is not supported as of now. You can use the bar chart with colur formatting (stacked bar is supported) not the clustered column chart.
You can create the measure likeBar Color =SWITCH(TRUE(),[Budget Total] > [Actual Total], "#2E7D32", -- green[Budget Total] < [Actual Total], "#C62828", -- red"#9E9E9E" -- default/else (equal or blank))
Use the bar chart colur formatting byplease consider as an accepted solution or give some kudos.
https://community.fabric.microsoft.com/t5/Desktop/Bar-chart-conditional-Y-Axis-Label-color-based-on-value-measure/td-p/2412331
https://community.fabric.microsoft.com/t5/Desktop/Conditional-Formatting-Y-axis-categories/td-p/2208667
You can upvote for the same feature availability in the future release
https://community.fabric.microsoft.com/t5/Fabric-Ideas/Conditional-formatting-of-a-category/idi-p/4525469
Hi mahendrakanouji,
Create a color measure:
Category Color =
IF(
[Budget] > [Actual],
"green",
IF(
[Budget] < [Actual],
"red",
"black"
)
)
Build a Matrix visual
- Rows: your Category dimension
- Values: Budget, Actual
- Apply conditional formatting on the Category column background or font color using your Category Color measure → Format by field value
Then place this Matrix directly to the left of your clustered bar chart, align row heights, remove borders, and hide the matrix headers. Visually it mimics a colored Y-axis label.