Forum Discussion

rdsuser's avatar
rdsuser
New Member
2 years ago
Solved

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 SiteProduction LineWeekly schedule time by Production Line
Outage type 112Main SiteLine A257
Outage type 115Main SiteLine A257
Outage type 245Main SiteLine B385
Outage type 15Secondary SiteLine 1120
Outage type 114Secondary siteLine 2240
     
  • rdsuser,

     

    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] ) )
        )
    )

     

     

  • Anonymous's avatar
    Anonymous
    2 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

  • rdsuser,

     

    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] ) )
        )
    )

     

     

  • Anonymous's avatar
    Anonymous
    Not 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.