The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
I'm not sure if this is possible in Power BI, but want to try workarounds
My requirement:
For my data given below, I want to color Actuals with a different color and my Non Actuals with a differnt color on a line chart.
Date | Value | Type |
1/1/2021 | 100 | Actuals |
1/2/2021 | 200 | Actuals |
1/3/2021 | 300 | Actuals |
1/4/2021 | 400 | Actuals |
1/5/2021 | 500 | Actuals |
1/6/2021 | 640 | Forecast 1 |
Solved! Go to Solution.
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:
Proud to be a Super User!
Paul on Linkedin.
Hi @klehar ,
Is this what you are looking for?
There are only categories under Type column: Actuals and Forecast1
I have moved them to the LEGEND section of the line chart visual.
Forecast1 just has one row in your sample data therefore it is shown as a dot.
Hi @Pragati11 sorry to biggie back on this but it kinda aligns.
I have a date axis, 1 line in my line graph and able to see forecast in my analytics. However it displays pff and is greyed out. Any logic to this?
Hi @Anonymous ,
Not sure if this is the right thread for you to post your question as i is not related to the question of the original thread.
Can you please create a new thread for your question? In this way you are not taking over other person's thread.
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:
Proud to be a Super User!
Paul on Linkedin.
@Pragati11 @PaulP
While your bar chart solution is quite intuitive, I'm using first the traditional line chart solution
However 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.
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:
Proud to be a Super User!
Paul on Linkedin.