Forum Discussion
trying
4 years agoFrequent Visitor
Max Value of Measure
Hi all,
i am struggeling to get the max value of the measure i have written here:
Total Complaints | Last 12 Months =
var maxDate = LASTDATE('Calendar'[Date])
var minDate = FIRSTDATE('Calendar'[Date])
Return
CALCULATE([cpm (complaints per millions)],
Filter('Calendar_helper','Calendar_helper'[Date]<=maxDate &&
'Calendar_helper'[Date]>=DATEADD(minDate,-12,MONTH)),
ALL('Calendar')
)
Can anyone help?
Thanks in advance and KR,
Daniel
Measure = Var T1 = Summarize( calendar, YearMonth, "_Value", [cpm (complaints per millions)] ) // This should return a table with months and the corresponding cpm. // you'll have to limit the data to the last 12 months // Maybe with a FILTER on the calender in the first argument in summarize or on T1 Var _Max = maxx( T1, _value)
To be more specific i'd need a .pbix for testing
3 Replies
- NickolajJessen
Solution Sage
I'm not sure what you are trying to accomplish, but where a link with 5 ways to do rolling 12 month 😊!
https://gorilla.bi/dax/5-ways-to-calculate-last-12-months-in-dax/
If this post solves your problem, accept it as a solution
Appreciate your kudos- tryingFrequent Visitor
thanks for the reply! I try to get the max value for the measure up above. Meaning which is the max value within those 12 months i have in the measure.
- NickolajJessen
Solution Sage
Measure = Var T1 = Summarize( calendar, YearMonth, "_Value", [cpm (complaints per millions)] ) // This should return a table with months and the corresponding cpm. // you'll have to limit the data to the last 12 months // Maybe with a FILTER on the calender in the first argument in summarize or on T1 Var _Max = maxx( T1, _value)
To be more specific i'd need a .pbix for testing