Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
In my data , I have
Monthyear, Person_ID, top_subscription, top_cancellation
I have a chart that has MonthYear in Dimension, and I want to see sum(top_subscription) for the current month and sum(top_cancellation) for the previous month.
So I use above Fonction. It works fine, except for januay data if a year is selected as a filter.
My question is : how to have the data for january even my year is selected ?
Thank you for your help.
Regards
Let vCount=num(Count(distinct Month));
use below exp:-
if(wildmatch(Month,'Jan')
,below(sum({<Year={'$(=year(addyears(yearstart(max([Start Date])),-1)))'},Month={'>=$(=month(yearstart(max([Start Date]))))<=$(=month(Max([Start Date])))'},Month=>}value),$(vCount)),
above(sum({<Year={'$(=year(addyears(yearstart(max([Start Date])),0)))'},Month={'>=$(=month(yearstart(max([Start Date]))))<=$(=month(Max([Start Date])))'},Month=>}value)))
Thank you Udit_K for your answer, but I have difficulties to understand.
I can see in your picture that it works but can't understand your code.
If Dimension Month = Janv => sum of value for previous year and month from 1st january to the date of analysis
else take the sum of previous month (with above)
Really it is a little bit fuzzy for me, can you please help me ?
Thank you