Forum Discussion
Hayleysea
Resolver II
6 years agoHow to get latest no blank value
Hi There,
I have ID's, Dates and Comments as per below (pretending that the latest date is 3/06/2020) I need to get the latest non blank comment to populate in my results column (blue text)
| Date | ID | Comment | Last available Comment |
| 29/05/2020 | 1.A | Hello | Hello 1 |
1/06/2020 | 1.A | Hello 1 | Hello 1 |
| 2/06/2020 | 1.A | Hello 1 | |
| 3/06/2020 | 1.A | Hello 1 |
I need the results to appear as they do in the 'Last available comment' column? How do I write this calculated column?
Thanks!!
Hi Hayleysea
try a measure
Last available Comment = var _lastDate = CALCULATE(MAX(Table[Date]), Table[Comment] <> BLANK() ) RETURN CALCULATE(LASTNONBLANK(Table[Comment], 1), Table[Date] = _lastDate )
4 Replies
- Hayleysea
Resolver II
This works! Thank you
- amitchandak
Super User
Hayleysea , Try like
calculate(LASTNONBLANKVALUE(Table[date],max([Comment])), filter(all(table), table[date]<=max(table[date])))
- Hayleysea
Resolver II
Thank you but I got this error: A circular dependency was detected: Table[comment].