Forum Discussion

dbrandone's avatar
dbrandone
Icon for Helper IV rankHelper IV
5 years ago
Solved

Average time from multiple rows per month

I have the below data already calculated in the far right column. The far right column is the time difference between the left 2 columns. I need to average the total times per month for a trend. 

 

I'm trying to break the measure into steps. I know I need to start by getting a sum of the time per month and then average them out. Can someone help me out with this.

 

 

  • Anonymous's avatar
    Anonymous
    5 years ago

    Hi dbrandone ,

     

    You can first create a month column.

    YearMonth = YEAR([Date])&"-"&MONTH([Date])

    Then

    Average per month = CALCULATE(AVERAGE('Table'[Hour]),ALLEXCEPT('Table','Table'[YearMonth]))

     

     

     

    Best Regards,

    Stephen Tao

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

2 Replies

  • I created a column that puts the time difference in a format that Power BI would recognize.

     

     

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi dbrandone ,

     

    You can first create a month column.

    YearMonth = YEAR([Date])&"-"&MONTH([Date])

    Then

    Average per month = CALCULATE(AVERAGE('Table'[Hour]),ALLEXCEPT('Table','Table'[YearMonth]))

     

     

     

    Best Regards,

    Stephen Tao

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.