Forum Discussion

SamTailor's avatar
SamTailor
Helper I
10 years ago
Solved

Monthly Average Grand Total calculation - Help needed

Hi!   I'm new in Power BI and can't figure out how to do a tricky thing with Grand Total of Average I have a table with Monthly averages, but grand totalin Power BI shows me SUM of these averages....
  • AlexChen's avatar
    10 years ago

    Hi,

     

    In this scenario, if you include “Direction” column into your table visual, definitely your measure will be sliced by “direction”. This is how DAX works. So you need to group on month in your calculation.

     

    AverageMeasure = CALCULATE(AVERAGEA(Direction[AV Plan]),ALLEXCEPT(Direction,Direction[Month #]))

     

     

    As to show Year Average basing on number of days in your top table of this case(I assume it’s called “Direction2”), You can create a following measure:

     

    avgMeasure = CALCULATE(sumx(Direction2, Direction2[monthDay] * Direction2[Average]) / sumx(Direction2, Direction2[monthDay]))

     

     

    Best Regards

    Alex