Forum Discussion

jigr69's avatar
jigr69
Frequent Visitor
8 years ago
Solved

Monthly Averages

I know similar questions have been asked and answered previous to this, but for the life of me, cannot get any of those working with my limited knowledge on Power BI.   I have a table which contain...
  • MFelix's avatar
    MFelix
    8 years ago

    If you are using a calendar table try using this:

     

    Monthly average _ =
    DIVIDE (
        CALCULATE (
            SUM ( In_Out[Total In] ),
            DATESBETWEEN (
                'calendar'[Date],
                STARTOFMONTH ( 'calendar'[Date] ),
                ENDOFMONTH ( 'calendar'[Date] )
            )
        ),
        CALCULATE (
            SUM ( In_Out[Total] ),
            ALLEXCEPT ( In_Out, In_Out[Month] ),
            DATESBETWEEN (
                'calendar'[Date],
                STARTOFMONTH ( 'calendar'[Date] ),
                ENDOFMONTH ( 'calendar'[Date] )
            )
        )
    )

     

    Regards,

    Mfelix