Forum Discussion
Conditional Formatting a Line Chart in Power BI
- 4 years ago
You can use two measures instead of conditional formatting: one measure for Actuals and the other for the Forecast values (this measure must include the actual values to avoid the blank space in the chart). so:
Actuals = SUM(Table [Actuals]
Forecast = SUM(Table [Forecast]) + [Actuals]Place both measures in the values bucket and then format each measure to your liking:
@PaulDBrown tagging you since you have context
- PaulDBrown4 years agoCommunity Champion
Here are two options:
1) Since the default line chart doesn' allow conditional formatting, you can hack it by creating a bar chart first, adding the conditional formatting and then changing it to a line chart.
I've created this measure to format the chart:
Line Colour = IF(MAX('Table'[Filter/Type]) = "Actuals", 1, 2)2) Use two measures for the line chart. The measure you already have for the forecast and another for "Actuals"
Actuals = CALCULATE([Sum Value],'Table'[Filter/Type] = "Actuals")Add both measures to the Values bucket and then format each meaure to your liking:
- klehar4 years agoHelper V
Pragati11 PaulP
While your bar chart solution is quite intuitive, I'm using first the traditional line chart solutionHowever I get a gap and want the lines to be joined on my actual dataset.
If this doesn't work I'll like to try the bar chart approach.
However what measure should i use in the bar chart in the value column, since conditional formatting requires me to have only 1 value.
- PaulDBrown4 years agoCommunity Champion
You can use two measures instead of conditional formatting: one measure for Actuals and the other for the Forecast values (this measure must include the actual values to avoid the blank space in the chart). so:
Actuals = SUM(Table [Actuals]
Forecast = SUM(Table [Forecast]) + [Actuals]Place both measures in the values bucket and then format each measure to your liking: