Forum Discussion
AThom
5 years agoNew Member
Select a value from a column based on another value from column.
I would like a measure that will select the the [Target -21/22] value based on the last value in the [21/22 - YTD] column. Can I get help with DAX that would acheiev this?
- 5 years ago
Ha yes, indeed
what about this approach instead :Measure = VAR _Lastdate = CALCULATE( MAX( YourTable[Date] ), ALL( YourTable[Date], YourTable[Month] ), YourTable[21/22 - YTD] > 0 ) RETURN CALCULATE( MAX( YourTable[Target - 21/22] ), YourTable[Date] = _LastDate )
m3tr01d
5 years agoContinued Contributor
Ha yes, indeed
what about this approach instead :
Measure =
VAR _Lastdate =
CALCULATE(
MAX( YourTable[Date] ),
ALL( YourTable[Date], YourTable[Month] ),
YourTable[21/22 - YTD] > 0
)
RETURN
CALCULATE(
MAX( YourTable[Target - 21/22] ),
YourTable[Date] = _LastDate
)
AThom
5 years agoNew Member
Thanks a lot, that worked