Forum Discussion
OracleGuru
6 years agoFrequent Visitor
Calculated Column = Latest value for each visit id
In the example below, I want to create a calculated column that shows the insurance from the last "Trx Date" for the patient's visit id on all rows for that patient's visit id.
- 6 years ago
OracleGuru try follow measure
Last Insurance = VAR __lastVisitDate = CALCULATE ( MAX ( 'Table'[Trx Date] ), ALLEXCEPT ( 'Table', 'Table'[Visit Id] ) ) RETURN CALCULATE ( MAX ( 'Table'[Insurance] ), ALLEXCEPT ( 'Table', 'Table'[Visit Id] ), 'Table'[Trx Date] = __lastVisitDate )
parry2k
6 years agoSuper User
OracleGuru try follow measure
Last Insurance =
VAR __lastVisitDate = CALCULATE ( MAX ( 'Table'[Trx Date] ), ALLEXCEPT ( 'Table', 'Table'[Visit Id] ) )
RETURN
CALCULATE ( MAX ( 'Table'[Insurance] ), ALLEXCEPT ( 'Table', 'Table'[Visit Id] ), 'Table'[Trx Date] = __lastVisitDate )
OracleGuru
6 years agoFrequent Visitor
Worked like a charm. Thank you very much.