Forum Discussion
Help needed: calculate the average loss caused by a specific type of outages
Hi everyone - as i'm very new to power BI I'd like to ask a potentially simple question.
I'm tryting to calculate the average loss caused by a specific type of outages in a production environment.
I have the data organized as per the table below. Each row represents an individual loss that took place within a week of production on variouse production lines in different production sites.
I want to calculate the following: Average of (Sum (Outage type 1)/schedule Line A), Sum (Outage type 1)/schedule Line 1)
Ther result should be the average of: (12+15)/257 and 5/120 and 14/240. Ofcourse the whole table has substantially more data then this and multiple outage types aso.
thanks!
Robert
Outage type | Outage loss(min) | Production Site | Production Line | Weekly schedule time by Production Line |
| Outage type 1 | 12 | Main Site | Line A | 257 |
| Outage type 1 | 15 | Main Site | Line A | 257 |
| Outage type 2 | 45 | Main Site | Line B | 385 |
| Outage type 1 | 5 | Secondary Site | Line 1 | 120 |
| Outage type 1 | 14 | Secondary site | Line 2 | 240 |
Try this measure. It groups by Outage Type and Production Line, and then computes the average. You can use MIN or MAX to get Weekly schedule time by Production Line since it's the same value for each combination of Outage type and Production Line.
Average Loss = AVERAGEX ( SUMMARIZE ( 'Table', 'Table'[Outage type], 'Table'[Production Line] ), DIVIDE ( CALCULATE ( SUM ( 'Table'[Outage loss(min)] ) ), CALCULATE ( MAX ( 'Table'[Weekly schedule time by Production Line] ) ) ) )- Anonymous2 years ago
Hi rdsuser
In addition to the DataInsights's method, allow me to add my method below:
Average Loss = AVERAGEX ( VALUES ( 'Table'[Outage type] ), AVERAGEX ( VALUES ( 'Table'[Production Line] ), DIVIDE ( CALCULATE ( SUM ( 'Table'[Outage loss(min)] ) ), CALCULATE ( MAX ( 'Table'[Weekly schedule time by Production Line] ) ) ) ) )Best Regards,
Jarvis Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
2 Replies
- DataInsights
Super User
Try this measure. It groups by Outage Type and Production Line, and then computes the average. You can use MIN or MAX to get Weekly schedule time by Production Line since it's the same value for each combination of Outage type and Production Line.
Average Loss = AVERAGEX ( SUMMARIZE ( 'Table', 'Table'[Outage type], 'Table'[Production Line] ), DIVIDE ( CALCULATE ( SUM ( 'Table'[Outage loss(min)] ) ), CALCULATE ( MAX ( 'Table'[Weekly schedule time by Production Line] ) ) ) ) - AnonymousNot applicable
Hi rdsuser
In addition to the DataInsights's method, allow me to add my method below:
Average Loss = AVERAGEX ( VALUES ( 'Table'[Outage type] ), AVERAGEX ( VALUES ( 'Table'[Production Line] ), DIVIDE ( CALCULATE ( SUM ( 'Table'[Outage loss(min)] ) ), CALCULATE ( MAX ( 'Table'[Weekly schedule time by Production Line] ) ) ) ) )Best Regards,
Jarvis Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.