Help with SORT

Hi,
I am trying to create a slice to show list of Equipment with Expired Calibration tests.
I have a table which will list the
Calibration Request Ref(key),
Item Id,
Date Calibrated
Calibration Due Date (Expiry Date)
etc.
Each time item is calibrated, a new row will be added so always want to check the most recent entry.

I have this expression in the Slice. Getting Error :Sort has invalid inputs.
Is there easier way of creating this list.

IFS(
Month(Today())<>โ€œ1โ€,
AND(
Day([Calibration Due Date])<Day(Today()),
Month([Calibration Due Date])<=Month(Today()),
YEAR(TOP(SORT([Calibration Due Date]),1))<=Year(Today())
),

Month(Today())=โ€œ1โ€,
YEAR(TOP(SORT([Calibration Due Date]),1))<Year(Today())
)

Solved Solved
0 10 632
1 ACCEPTED SOLUTION

Steve
Platinum 4
Platinum 4

To get your slice to display only the row for each Item Id with the latest Calibration Due Date, try this as the row filter expression (replace MyTable with the name of the table the slice is built upon):

(
  [_THISROW]
  = MAXROW(
    "MyTable",
    "Calibration Due Date",
    ([_THISROW].[Item Id] = [Item Id])
  )
)

To get your slice to display only the row for each Item Id with the latest Calibration Due Date only if the Calibration Due Date is due, try this:

(
  TODAY()
  >= MAX(
    SELECT(
      MyTable[Calibration Due Date],
      ([_THISROW].[Item Id] = [Item Id])
    )
  )
)

View solution in original post

10 REPLIES 10
Top Labels in this Space