Forum Discussion
ggzmorsh
Helper II
5 years agoCalculate MAX text value
I have Table1 which contains 4 occurrences of the same ID happening in different date/times and remarks. What i need to do is to return the most recent remarks which is "A". I tried using max value ...
- Anonymous5 years ago
Hi ggzmorsh ,
You can create a measure as below:
Latest remark = VAR _maxdate = CALCULATE ( MAX ( 'Table'[Date] ), ALLEXCEPT ( 'Table', 'Table'[ID] ) ) RETURN CALCULATE ( MAX ( 'Table'[Remarks] ), FILTER ( 'Table', 'Table'[ID] = MAX ( 'Table'[ID] ) && 'Table'[Date] = _maxdate ) )Best Regards
amitchandak
Super User
5 years agoggzmorsh , Try measure like
lastnonblankvalue(Table[Date],Max(Table[Remark]))
or
calculate(lastnonblankvalue(Table[Date],Max(Table[Remark])), allexpect(Table, Table[ID]))
ggzmorsh
Helper II
5 years agoMy dear, I have used the formula
Last Remark = LASTNONBLANKVALUE(Table1[Date],MAX(Table1[Remark]))which worked on a smaller scale however when used with a table which contains more than 15 million rows it is returning me wrong data.