Max () and Select

I have this expression associated with an action button,

Select (orders[serial],and([Customer_ID]=[_THISROW].[Customer_ID], [ID_Number]=[_THISROW].[ID_Number]+ Max(SELECT(Orders[Order_Date],True ))))

Note: This expression could impact performance.

The list of values of column ‘Serial’

…from rows of table ‘Ordini’

…where this condition is true: (ALL these statements are true:

…1: (The value of column ‘ID_Cliente’) is equal to (The value of ‘ID_Cliente’ from the row referenced by ‘ID_Numero’)

…2: (The value of column ‘ID_Numero’) is equal to ((The value of ‘ID_Numero’ from the row referenced by ‘ID_Numero’ + MAX(

…The list of values of column ‘Data_Ordine’

…from rows of table ‘Ordini’

…where this condition is true: (“True”)))))

but it doesn’t work, I would like to get the latest Serial value based on the customer order date. you can help me?? thank you

To get the latest order row for a customer, you could use a MAXROW() expression like this:

MAXROW("Orders", "Order_Date", [Customer_ID]=[_THISROW].[Customer_ID])

To get the [Serial] value from this row you could use an expression like this:

SELECT (orders[serial], [Row Key] = MAXROW("Orders", "Order_Date", [Customer_ID]=[_THISROW].[Customer_ID]))

NOTE: replace [Row Key] column name with the actual name of the column set as the key on your Orders table.

I hope this helps!

SELECT (orders[serial], [Row Key] = MAXROW(“Orders”, “Order_Date”, [Customer_ID]=[_THISROW].[Customer_ID]))

Tks more