Initial value based on most recent DateTime value row with another criteria

Hi Guys 

I have the following table, column and reference structure

“Exercises” table:
-[Exercise Name ID] key column
-[Exercise Name] label column

“Workout Day Exercises” table:
-[Workout Exercises Key] key column
-[Exercise Name] column referenced to the “Exercises” table
-[Exercise Started] which is a DateTime column type
-[Weight] which is a Decimal column type

I am looking for Initial Value formula for the [Weight] column that will return the row that has the most recent DateTime value within the [Exercise Started] column where the value selected in this row within the [Exercise Name] column is the same.

Below is picture of the table that might make it easier to explain what I want to achieve

Skip2MiLu_0-1696788414363.png

 




0 1 51
1 REPLY 1

Aurelien
Google Developer Expert
Google Developer Expert

Hi @Skip2MiLu 

Based on this awesome thread from @Steve , what about using the MAXROW() expression:

LOOKUP(
  MAX(
    SELECT(
      Workout Day Exercises[Exercise Started],
      ([_THISROW].[Exercise Name] = [Exercise Name])
    )
  ),
  "Workout Day Exercises",
  "Exercise Started",
  "Weight"
)

 

Top Labels in this Space