Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Average on Matrix Subtotals

Hello, Power BI Experts!   Just couldn't find through the same questions on the community the solution that might help me. Will appriciate any help!   I need to calculated average on column subto...
  • Anonymous's avatar
    Anonymous
    7 years ago

    hi, v-cherch-msft, thank you for your reply.

     

    I tried ALLSELECTED() and it turned out that this is not my case.

    But hopefully I found a solution.

     

    I recalculated Average Number of Weeks in a Month:

    TotalHours = SUM(TT_TimeEntries[Duration])

    NumberOfWeeks = AVERAGEX(TT_TimeEntries, [NumberOfDaysInAMonth] / 7)

     

    And created a final measure as:

     

    AverageHoursInAWeek =
    AVERAGEX (
    VALUES ( 'TT_TimeEntries'[Time Entry Year Month] ),
    CALCULATE ( DIVIDE ( [TotalHours], [NumberOfWeeks]) )
    )

     

    The final result is:

     

     

    Hope somebody could use this in future.