Forum Discussion

ReadTheIron's avatar
ReadTheIron
Helper III
3 years ago
Solved

Count repeats in a time frame

I have two tables, one of failures, one of repairs, related on EquipmentName. I'm trying to find out if a given piece of equipment failed in the year after it was repaired. RepairTable Equipment...
  • amitchandak's avatar
    3 years ago

    ReadTheIron , New column in repair table

     

    In next 1 year =

    var _cnt = countx(filter(FailureTable, FailureTable[EquipmentName] =RepairTable[EquipmentName] && FailureTable[FailureDate] >=RepairTable[RepairDate] && FailureTable[FailureDate] <= RepairTable[RepairDate] +365) ,FailureTable[EquipmentName])

    return

    if(isblank(_cnt), "No", "Yes")