Slice by latest date

Hello,

Trying to create a slice that is filtered based on latest date. Example given below where the golfer with the latest date is returned (i.e. ID 3 is removed from the slice)

Data

ID GolferID Type Hcap Date
1 1 GUI 16 29/06/2020
2 2 GUI 12 29/06/2020
3 3 GUI 18 29/06/2020
4 3 GUI 17 16/07/2020

Slice

ID GolferID Type Hcap Date
1 1 GUI 16 29/06/2020
2 2 GUI 12 29/06/2020
4 3 GUI 17 16/07/2020

Thanks for any help,
Pat

1 Like

Thanks Steve, tried a few examples to get this to work but failing miserably

LOOKUP( MAX( SELECT( HcapGUI[_ROWNUMBER], ([_THISROW].[Date] = [Date]) ) ), “HcapGUI”, “_ROWNUMBER”, “HcapID” )

The expression is valid but its result type ‘Ref’ is not one of the expected types: Yes/No

If I wasn’t clear, I’m trying to get multiple rows returned not just one row.

For a slice, the expression is something like:

[_ROWNUMBER] =
	MAX(
	  SELECT(
		HcapGUI[_ROWNUMBER],
        ([GolferID] = [_THISROW].[GolferID])
     )
    )

to get the Yes/No expected type.

4 Likes

Thank you very much. Worked first time :+1:

1 Like