Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and a 50 percent discount on exams.
Get startedEarn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi,
I was wondering if there was a way to color code a line graph. I looked it up, and on some versions of Power BI, there is either an advanced option on the Data colors editor, or 3 vertical dots to indicate the advanced option. On my version, there are neither even for the clustered column chart visualization.
I was wondering if there was a formula I could use to say, if total for 2020<2019 then green, else if 2020>2019 and 2020-2019>100 then red, else yellow or something along those lines...
Please let me know if this question is confusing
Thank you!
Sarah
I don't think there's anything like this, but maybe you could try to visualise your data in a different way and make a measure to show the year on year difference - drop that into a line chart, then you can use the constant lines feature to highlight the points where you'd want the formatting to change?
Hi @jthomson ,
Condittional formatting is not possible on line charts.
What you can do is use measure to calculate the higher and lower and then for those measure place markers with different colours and hide the line.
What I did was to create 5 measures:
Current Year = SUM('Table'[Value])
Previous Year = CALCULATE(SUM('Table'[Value]);DATEADD('Calendar'[Date];-1;YEAR))
Previous 2 year = CALCULATE(SUM('Table'[Value]);DATEADD('Calendar'[Date];-2;YEAR))
Higher = IF([Current Year]<[Previous Year];BLANK();[Current Year])
Lower = IF([Current Year] < [Previous Year];[Current Year];BLANK())
Then place the measures on the line chart and final result will be this one (colors are not the best ones):
I also used a calendar table and a slicer to select the year.
Check PBIX file attach.
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsI feel like I am close, but I am not sure how to encorperate the Red and Green dots if it is above or below last years totals...
Hi @Anonymous
You need to go to the line chart options:
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em Português