Forum Discussion
KW123
Helper V
4 years agoPrevious Month
Hi, I need to get the MAX (or last value) of a previous month for a measure [WhatdoesYTDtotalneedtobe] I have tried using this DAX as both a measure and a column, but it only returns blanks. ...
KW123
Helper V
4 years agoIf I use this DAX:
Prevmonth =
CALCULATE(
SUMX(
'2022 Goals',
'2022 Goals'[What does YTD total need to be]
),
FILTER(
ALL(Dates),
Dates[Year] = MAXX (Dates, Dates[Year]) &&
Dates[Month] = MAXX(Dates,Dates[Month]) -1
))
I still get a blank result. However if I add
then it gives me the max of the current month but blanks for the first and last day of that month. So I am assuming it's -1 of the day rather than the month.
The Date table shares a relationship by month name to the goals table. I have tried using [Month name] instead but no result.
I still get a blank result. However if I add
&&
Dates[Date] = MAXX(Dates,Dates[Date]) -1
then it gives me the max of the current month but blanks for the first and last day of that month. So I am assuming it's -1 of the day rather than the month.
The Date table shares a relationship by month name to the goals table. I have tried using [Month name] instead but no result.