Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
There is an issue that I have to solve very quickly and I wanted to consult your knowledge. I have a table where the data of each month is kept in a separate column and in the table I want to create, I should show the actual values such as this month, last month, 3 months ago.
I created the following parameter to get the month I want from the columns:
vActual: ='Act_'& [Month(Num)]
(gives October data: like Act_10.)
For 3 Months before
v3MonthsAgo: =Date(AddMonths(Max(YearMonth),-2),'YYYYYMM')
sum({<“$(v3MonthsAgo)”= $(v3MonthsAgo)>} “$(vActual)")
However, in all cases, it shows the last month's realization. How can I fix this?
@Milaf as you are using YearMonth itself as dimension, set analysis won't work. Set analysis works once per chart. You need if condition here
v3MonthsAgo: =Date(addmonths(date#(Max(YearMonth),'YYYYMM'),-2),'YYYYMM')
sum(aggr(if(YearMonth>=$(v3MonthsAgo), [$(vActual)]),YearMonth))
or
sum(if(YearMonth>=$(v3MonthsAgo), [$(vActual)]))