YOY Trend in a Table Column

Hi Team,

I am trying to create a trend based colour coded column in a data visual in Power BI.
I have sales from FY 2018 to date. My aim is to create a growth trend for products based on Year on Year sales.
If the YOY variance in sales for an item is >=5%, I want the trend to show green in the column, if YOY variance is <5%, red colour background and if the variance is between 5 and -5, yellow.
And two exceptions - if the variance is 0 for new products, it will be blue and anything else is orange.

Is there a formula which I can create in DAX to give me the result? and then a way I can format the background in the visual using some rules.

Please guide me.
Attached visual of what is needed.


Please take a look at the thread below. I think it provides all the information you need to meet this requirement. Be sure to read all the way to the end of the thread, because each contributor added improvements to the original approach suggested.

I hope this is helpful.

– Brian

Hi @Nupur, a response on this post has been tagged as “Solution”. If you have a follow question or concern related to this topic, please remove the Solution tag first by clicking the three dots beside Reply and then untick the check box. Also, we’ve recently launched the Enterprise DNA Forum User Experience Survey, please feel free to answer it and give your insights on how we can further improve the Support forum. Thanks!