Highlight the earliest date when a condition is met

I’m currently working on creating a filtered table that highlights the row with the earliest date.

I have 3 columns: Item, Purchased?, Date Purchased.

When Purchased? is toggled on, I want the row with the earliest Date Purchased highlighted using conditional format.

Can’t seem to do it properly. Could you give me more insights?

Hi @ajjjj,

Try this formula out under conditional formatting:

thisRow = Table.Filter([Purchased?] = true).Sort(false(), Table.[Date Purchased]).First()

If you want to play around with the example doc, copy the doc to see what’s under the hood. I’ve included some comments in the doc on what the formula is doing: https://coda.io/d/_dZPt5We9Ea1/Highlight-latest-Example_su1Cg

Best regards,
Sam Harper
Product Manager

thanks, Sam! I tried it on my coda page but it did not work. Was not able t o specify that I used toggle instead of checkbox. Although, it may not be the issue.

Also, does the “Table” in the code need to be changed to the actual name of the table?

Hi, in a word, YES, when using Coda formulas to cause actions on your tables, specifying the correct table name is crucial!

Fortunately, the Coda formula editor’s “intellisense” will suggest (correctly at times), the available table name(s) allowing you to easily select when editing your formulas.

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