Forum Discussion
Return Text Value Based on Client ID and Last Date
- 5 years ago
samdep , use this measure for ItemPurchased, if needed take max of date
Measure =
VAR __id = MAX ('Table'[ClientID] )
VAR __date = CALCULATE ( MAX('Table'[PurchaseDate] ), ALLSELECTED ('Table' ), 'Table'[ClientID] = __id )
CALCULATE ( max ('Table'[ItemPurchased] ), VALUES ('Table'[ClientID] ),'Table'[ClientID] = __id,'Table'[PurchaseDate] = __date )
Hi,
This formula is exactly what I need however it keeps telling me the syntax for CALCULATE is incorrect.
Any ideas how to overcome this?
Hi,
I also have an similar issue but keep getting an error with the calculate. Did you manage to find a solution for the calculate error? I don't think anyone replied back for a full response to the calculate error in the below measure....
Did you finally get a solution? Could you share if possible?
Thanks in advanced.
Measure =
VAR __id = MAX ('Table'[ClientID] )
VAR __date = CALCULATE ( MAX('Table'[PurchaseDate] ), ALLSELECTED ('Table' ), 'Table'[ClientID] = __id )
CALCULATE ( max ('Table'[ItemPurchased] ), VALUES ('Table'[ClientID] ),'Table'[ClientID] = __id,'Table'[PurchaseDate] = __date )
- bbwong3 years ago
Helper I
Hi,
You could try this:
Measure =
VAR __id = MAX('Table'[ClientID])
VAR __date =
CALCULATE(
MAX('Table'[PurchaseDate]),
ALLSELECTED('Table'),
'Table'[ClientID] = __id
)
RETURN
CALCULATE(
MAX('Table'[ItemPurchased]),
'Table'[ClientID] = __id,
'Table'[PurchaseDate] = __date
)