Forum Discussion
Last 12 months showing same value
- Anonymous3 years ago
Mikelytics , I was able to make this work but by different method - "USERELATIONSHIP". Here is the code:
_previous_amount =
var ReferenceDate = MAX('Calendar'[Calendar_last_day_of_month])
VAR PreviousDates =
DATESINPERIOD('Previous Date'[Calendar_last_day_of_month],ReferenceDate, -13, MONTH)
var result =
CALCULATE(sum(ACTUALS_BY_MONTH[AMOUNT]),
REMOVEFILTERS('Calendar'),
KEEPFILTERS(PreviousDates) ,USERELATIONSHIP('Calendar'[Date], 'Previous Date'[Date]))
RETURN
result*************
Previous Date ='Calendar'
Results:
Here is Youtube reference that I followed
https://www.youtube.com/watch?v=d8Rm7dwM6gc
Thanks for all of your suggestions and time!
Hi Anonymous
This is really weird. I tried out your measure and it worked on my side. Can please show your data model and how you set up the canvas? Especially how looks your calendar table like?
Best regards
Michael
-----------------------------------------------------
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Appreciate your thumbs up!
@ me in replies or I'll lose your thread.
- Anonymous3 years agoNot applicable
Mikelytics I am generating Calendar like below
Calendar = CALENDARAUTO()please see the sreenshot of calendar tableand this is how canvas is been set up. "CY Actuals Through" is "calendar_last_day_of_month" from 'Calendar'.Please let me know if you need any other information.
thanks!