Forum Discussion

MR2001's avatar
MR2001
Icon for Helper II rankHelper II
10 years ago
Solved

Reference a measure in another measure

Hello,   Is it possible to reference a measure in another measure? If yes, then can you please provide an example?   Thank you, M.R.
  • Anonymous's avatar
    Anonymous
    10 years ago

    I just realized I made a mistake in my code. That code for Last Entry will return the date of the last entry, not the last entry itself. Looking back at your original formula I think it should be

     

    Last Entry = CALCULATE(
    	LASTNONBLANK( 'Trends'[Total Unresolved], 1),
    	DATESMTD(DateTable[Date])
    )

    ...or whatever the column is with the number you're trying to tally. Not the timestamp column.

     

    Now, if you really really want to have that last date with an entry, add a third measure:

     

    Last Date = CALCULATE(
    	MAX('Santiago Trends'[action_timestamp]),
    	DATESMTD(DateTable[Date])
    )

    You could use my original mistake version of Last Entry, but this version also works, and is slightly easier to type.