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!
Mikelytics , Actuals_Volume is a measure defined as below
Actuals_Volume = COALESCE(sum(Actuals_by_Month[AMOUNT]),0)
Have never seen COALESCE 😄
Did you try taking it out on only use SUM?
sum(Actuals_by_Month[AMOUNT])
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 yeah, tried just the sum without COALESCE. No luck 😓
- Mikelytics3 years ago
Resident Rockstar
Anonymous
hmm
Is the field you put into the slicer from the calendar table or from the fact table?
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 from Calendar.