Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
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
EquipmentArea | EquipmentName | RepairDate |
North | Switch1 | 1/1/2020 |
North | Switch2 | 2/1/2020 |
South | Switch3 | 3/1/2020 |
East | Switch4 | 4/1/2020 |
South | Switch5 | 5/1/2020 |
South | Switch6 | 6/1/2020 |
FailureTable
EquipmentName | FailureDate |
Switch1 | 6/1/2020 |
Switch4 | 8/1/2020 |
Switch2 | 1/1/2021 |
Switch1 | 5/1/2021 |
Switch3 | 8/1/2021 |
Whatever solution makes most sense - a measure, a calculated column - should let me filter visuals by whether a piece of equipment failed in the first year after repair. Examples might look like:
Problem Equipment |
Switch1 |
Switch2 |
Or
EquipmentArea | Failed First Year |
North | 2 |
I have a calculated column counting the total number of failures after the repair date, but I don't know how to add a time frame to that:
Solved! Go to Solution.
@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")
@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")
Clear and elegant! Thank you!
User | Count |
---|---|
77 | |
77 | |
68 | |
67 | |
49 |
User | Count |
---|---|
108 | |
105 | |
93 | |
83 | |
64 |