Forum Discussion

AThom's avatar
AThom
New Member
5 years ago
Solved

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?  
  • m3tr01d's avatar
    m3tr01d
    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
    )