How to use ORDER BY for descending

This may be an indication that I'm using this function wrong or perhaps using the wrong function, but here's my question...

I have a table of contacts for devices that need to have quality control performed (calibration). I want to calculate the LATEST (most recent) date where the result of the QC test in the event table is "Pass". I seem to be able to find the EARLIEST date on a per unit basis, but I cannot reverse the order of the ORDER BY function.

Here is the cell logic.

=FINDROW(filter(EventData,"EventData[QC Result]=%","Pass"),"EventData[Unit]=% ORDER BY EventData[Date]",THISROW()[Unit])[Date]

In other words, find the date of the last event where the result QC was "Pass" and the unit (device identifier) is the same as the unit described in this row.

I can use the modifier "ASC" for ORDER BY, but that seems to be the default behavior (perhaps I'm wrong). I tried "DSC" and "DEC". Is there a descending order modifier?


If it matters, I can't be certain that the order of rows in the table will always be correct. Otherwise, I'd use FINDLASTROW(). Perhaps I should make sure that the entries are always filed in chronological order?

@Paul-d819 it's "DESC", also confused me at first. There's an example in the filter docs: Filter( ).

1 Like

Thank you Andrew! That solved it!

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.