Forum Discussion
Problem with Moving Annual Total
Im looking after the Rolling Year.
In my Datetable I've created columns which yield in TRUE if a certain condition is fullfilled. This columns are dynamic, since I do not want to change the filter context each time when refreshed. For example the column for last year is calculated as follows:
LastYear = if(Year(DATEADD('Calendar'(Date);12;MONTH))=Year(Today());"TRUE")
Now I want to do a visual with lines or stocked columns for each product subcategorie, which display as well the rolling year started in the month before. In the datetable this is created by:
LYM-1 = if(Year(DATEADD('Calendar'(Date);13;MONTH))=Year(Today());"TRUE")
Based on this columnes I can achieve the value for the period in question. The measures look like:
LYSales = Calculate(Sum(Sales(SalesAC));Filter(all('Calendar');'Calendar'(LastYear)="TRUE"))
LYM-1Sales = Calculate(Sum(Sales(SalesAC);Filter(all('Calendar');'Calendar'(LYM-1)="TRUE"))
But I'm not able to visualize this in a stacked column or line chart, where each column, respective each datapoint on the line represents a rolling year(eg. LYSales and LYM-1Sales). Do you have any ideas how to solve this problem?
Thanks for your help.
I've now got no idea where your problem lies. Is it in the measure logic, or in getting the appropriate subset of values to display on the axis?