Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello,
I want to create a measure which will calculate the average duration of task(s) completed by a machine.
There are two task types: 'Task', and 'Parent Task'. Every 'Parent Task' has one 'Task'.
All of the data I require is held against the 'Task', except for one column which is recorded against the 'Parent Task'.
What I want to achieve, looks like this (the right-most column); can anyone suggest how to do this?
Machine Number | Task | Duration | ParentTask | Desired Duration Measure Output (average duration) |
MCN51 | T1 | 0 | P1 | 1 |
MCN51 | T2 | 0 | P2 | 3 |
MCN51 | P1 | 1 | <blank> | <blank> or 0 |
MCN51 | P2 | 3 | <blank> | <blank> or 0 |
Total | 4 | 2 |
Solved! Go to Solution.
Hi @jernau,
Please try the formula below.
Measure 2 = AVERAGEX ( 'Table1', CALCULATE ( AVERAGE ( Table1[Duration] ), FILTER ( ALL ( Table1 ), Table1[Task] = EARLIER ( Table1[ParentTask] ) ) ) )
Best Regards,
Dale
Hi @jernau,
Please try the formula below.
Measure 2 = AVERAGEX ( 'Table1', CALCULATE ( AVERAGE ( Table1[Duration] ), FILTER ( ALL ( Table1 ), Table1[Task] = EARLIER ( Table1[ParentTask] ) ) ) )
Best Regards,
Dale
That worked really well, thank you Dale!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
95 | |
80 | |
68 | |
59 |
User | Count |
---|---|
150 | |
119 | |
104 | |
87 | |
67 |