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. ...
Greg_Deckler
Community Champion
4 years agoKW123 Hard to say without actual example data. You can get last month by using EOMONTH([Date], -1) that will get you the last day of the month, is that what you want? Or do you want to get MAXX of some value that exists in the last month?
- KW1234 years ago
Helper V
Greg_Deckler Thanks for the reply!
I have a separate column already with the previous days. I'm looking for a measure which will return the last day (is the same as the max) $ value from the previous month.
My DAX measure for the column I need isWhat does YTD total need to be =VAR A = [Accounting goal calc-c]VAR B = [Daily Goal]VAR CurrentIndex =SELECTEDVALUE ( Dates[FD2] )VAR MaxIndex =CALCULATE ( MIN ( Dates[FD2] ), ALLEXCEPT ( Dates, Dates[Date] ) )RETURNIF (DAY ( SELECTEDVALUE ( Dates[Date] ) ) = 1&& MONTH ( SELECTEDVALUE ( Dates[Date] ) ) = 1,0,IF ( CurrentIndex <> BLANK (), A + ( MaxIndex - CurrentIndex ) * B ))
Basically a running total based on the day of the week. I need the MAX value to be able to use it in another measure to calculate something for a separate column. I hope that helps a bit more.