Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
I need to do this as a calculated column and there is no date table - I know we need a date table, but I'm taking over this dataset and will build it properly, until then, I can't add a date table or else many calculations break. We have machine ID numbers and dates that they have been inspected. For each date, we measure the size of the padding on some components on the machine. Everytime the padding increases by 9 inches or more, we know the component has been replaced in the next inspection date. There's a column that identifies if the wear has been 9 inches or more. Machines can have components replaced multiple times. I need to identify the last time the component was replaced - so the inspection after the last time the wear was 9+ inches - and mark each inspection since then as "Active" and the others as "Inactive". I need to do this for each machine ID number.
Below is an example of the data I have so far. The "Status" column is what I need to solve for. Can anyone please help me solve this?
| Machine ID | Inspection Date | Component Wear | Status |
| 12345 | 5/29/2023 | 2 | Active |
| 12345 | 3/25/2023 | 5 | Active |
| 12345 | 1/15/2023 | 2 | Active |
| 12345 | 12/22/2022 | 10 | Inactive |
| 12345 | 6/5/2022 | 3 | Inactive |
| 54545 | 4/29/2023 | 4 | Active |
| 54545 | 2/25/2023 | 9 | Inactive |
Solved! Go to Solution.
Hello @itsme
Try the below Dax.
Let me know if you have any questions or issues.
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.
Hello @itsme
Try the below Dax.
Let me know if you have any questions or issues.
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 48 | |
| 45 | |
| 41 | |
| 20 | |
| 17 |
| User | Count |
|---|---|
| 69 | |
| 64 | |
| 32 | |
| 31 | |
| 27 |