Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Checking status for three most recent dates per device

Hi all,   I am trying to create an indicator that will tell me if there's an issue with a device. "Issue" is defined as the status = failed for all three of the most recent entries per device.   ...
  • Greg_Deckler's avatar
    6 years ago

    Anonymous  - I think you could do it by creating a custom column like:

     

    Rank = RANKX(FILTER('Table (2)', [Device] = EARLIER([Device])),[Date])

     

    Then you could create a measure like:

    Measure = 
        VAR __Table = SUMMARIZE(FILTER('Table (2)',[Rank]<=3),[Status])
    RETURN
        IF(MINX(__Table,[Status])="Fail" && COUNTROWS(__Table)=1,"TRUE","FALSE")