Forum Discussion
YoY Measure showing only final
- 8 years ago
Hi,
Try this
=IF(ISERROR(CALCULATE([Gross Margin],NEXTYEAR(Calendar[Year]))),([Gross Margin]-CALCULATE([Gross Margin],PREVIOUSYEAR
(Calendar[Year])))/[Gross Margin],BLANK())
Ensure that the years in your visual are dragged from the calendar table and there is a relationship between the Date column of your source data table to the date column of your calendar table.
Hope this helps.
Basic pattern for YoY measure would be:
Margin Growth = [Gross Margin] - CALCULATE( [Gross Margin] , DATEADD('Date'[Date], -1, YEAR) )Where 'Date'[Date] is a column of type = Date with a continuous and unique instance for each day (ie exactly one day for every day of the year). You must have a relationship between this Date table and your FACT table.
In your example table visual you show both 2016 and 2017. If you use the above measure, you will see Margin Growth for both years. The column within 2017 will show (2017 - 2016), and the 2016 column will show [Gross Margin] for (2016 - 2015).