Slice by latest date

PatM
New Member

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

Solved Solved
0 4 1,052
1 ACCEPTED SOLUTION

For a slice, the expression is something like:

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

to get the Yes/No expected type.

View solution in original post

4 REPLIES 4

Steve
Platinum 4
Platinum 4

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.

Thank you very much. Worked first time

Top Labels in this Space