Forum Discussion
Anonymous
4 years agoNot applicable
Using LookupValue to return the Max Value
This is what my data looks like: Account ID Quarter Mapped Account Name ABC Inc ID143 20Q3 ABC Inc. ID143 20Q4 ABC Incorp ID143 21Q1 ABC ID143 21Q2 My go...
- 4 years ago
This works as a calculated column. If you want to use it as a measure, then you need an aggregating function for Account_Data_Total[ERM ID] in your definition of VAR erm.
Try this:
Mapped Account Name = VAR erm = SELECTEDVALUE ( Account_Data_Total[ERM ID] ) VAR maxqtr = CALCULATE ( MAXX ( Account_Data_Total, Account_Data_Total[Quarter] ), FILTER ( Account_Data_Total, Account_Data_Total[ERM ID] = erm ) ) RETURN LOOKUPVALUE ( Account_Data_Total[Account], Account_Data_Total[ERM ID], erm, Account_Data_Total[Quarter], maxqtr )
AlexisOlson
4 years agoSuper User
This works as a calculated column. If you want to use it as a measure, then you need an aggregating function for Account_Data_Total[ERM ID] in your definition of VAR erm.
Try this:
Mapped Account Name =
VAR erm = SELECTEDVALUE ( Account_Data_Total[ERM ID] )
VAR maxqtr =
CALCULATE (
MAXX ( Account_Data_Total, Account_Data_Total[Quarter] ),
FILTER ( Account_Data_Total, Account_Data_Total[ERM ID] = erm )
)
RETURN
LOOKUPVALUE (
Account_Data_Total[Account],
Account_Data_Total[ERM ID], erm,
Account_Data_Total[Quarter], maxqtr
)