Initial Value based on Max [Timestamp]

Hi.

I have a column [AM/PM Charge] in Table Operations_Master_Check and I want the initial value of this to be the same as the row in the table with the MAX() [Pre-Treatment Timestamp]. This MAX() timestamp is not necessarily the maximum row in the table so I cannot use MAXROW(). I tried a virtual column with App Formula MAX(SELECT(Operations_Master_Check[Pre-Treatment Timestamp],TRUE,TRUE)) and set the initial value in the [AM/PM Charge] column to [Max Pre-Treatment Timestamp].[AM/PM Charge] but I am getting the following error.

Column Name โ€˜AM/PM Chargeโ€™ in Schema โ€˜Operations_Master_Check_Schemaโ€™ of Column Type โ€˜Enumโ€™ has an invalid Initial Value of โ€˜=[Max Pre-Treatment Timestamp].[AM/PM Charge]โ€™. Error in expression [Max Pre-Treatment Timestamp].[AM/PM Charge]

Any help in the right direction on this would be great, thank you.

0 4 488
4 REPLIES 4

So how are you identifying it then?

This expression can be reduced to just:

MAX( Operations_Master_Check[Pre-Treatment Timestamp] )

Is [Pre-Treatment Timestamp] the key column of this table?

Thank you @Marc_Dillon

  1. When I edit an existing record (the entire record is broken up into different slices) I want the Initial Values of some of the fields to be set to the same values as the record with the highest [Pre-Treatment Timestamp] value in the table.

  2. I had that alternative expression in as well. I assume either is ok?

  3. No [Pre-Treatment Timestamp] is not the key value.

Ok, sure. Just the way you said it before made me think it wasnโ€™t just a straight-forward MAX(). Are you wanting it to only be the max in the current slice?

Yah they do the exact same thing.

Ok, then โ€œ[Max Pre-Treatment Timestamp].[AM/PM Charge]โ€ is not going to work. This is a dereference expression, the column before the period needs to be a Ref-type column, which you shouldnโ€™t have if this column was built off of the [Pre-Treatment Timestamp] value.

There are multiple ways to get this value. Iโ€™m not currently coming to a conclusion as to which is best, but this should work.

LOOKUP(
MAX( Operations_Master_Check[Pre-Treatment Timestamp] ),
โ€œOperations_Master_Checkโ€,
โ€œPre-Treatment Timestampโ€,
โ€œAM/PM Chargeโ€
)

Thanks a million @Marc_Dillon.

I will test your suggestion.

Top Labels in this Space