Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
Could anyone help me with this issue below:
I wrote this expression for the last period in my dataset and it`s fine:
IF(Period_end_date=(max(TOTAL Period_end_date)),1)
But the issue is that I'm struggling with expression to write '1' for my previous period.
So my question is how to write '1' ONLY for the previous month, last day period?
I was trying something like that but it's not working:
IF(Period_end_date=Monthend(AddMonths(max(TOTAL Period_end_date),-1)),1)
It didn't work. But still thanks for helping!
I have already managed it with this expression:
IF([Period_end_date.autoCalendar.YearMonth]=(AddMonths(max(TOTAL[Period_end_date.autoCalendar.YearMonth]),-1)),1)
may be try set expression, hopefully your date field is not a timestamp field, sometimes it creates problem in comparison if the date field got decimal part.
Max({<Period_end_date = {"=$(=Monthend(Max(Period_end_date),-1))">}>}Period_end_date)
if it doesn't work, pl share some sample data, date comparison in set analysis is tricky.
It didn't work. But still thanks for helping!
I have already managed it with this expression:
IF([Period_end_date.autoCalendar.YearMonth]=(AddMonths(max(TOTAL[Period_end_date.autoCalendar.YearMonth]),-1)),1)