Forum Discussion

admin11's avatar
admin11
Icon for Memorable Member rankMemorable Member
5 years ago
Solved

How to compute GL Expense average 12 month amount ?

Hi All I have last 12 month Expense amount in stright table.  Can some one share with me how to create expression for compute last 12 month averyage expense ? Expected to get = 42,952.00   ...
  • v-kkf-msft's avatar
    v-kkf-msft
    5 years ago

    Hi admin11 ,

    Try the following formula:

    avg = 
    var _table = 
        FILTER(
            'Date',
            NOT(ISBLANK([AMOUNT]))
        )
    var _Date = MAXX(_table,'Date'[Date])
    var _First =  EOMONTH( _Date, -12 )
    return 
        -DIVIDE(
            CALCULATE(
                [AMOUNT],
                FILTER(
                    _table,
                    'Date'[Date] > _First
                )
            ),
            12
    )

    If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.

    Best Regards,
    Winniz

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

  • v-kkf-msft's avatar
    v-kkf-msft
    5 years ago

    Hi admin11 ,

    Try to modify the measure Amount to the following formula:

    AMOUNT = 
    CALCULATE(
        SUM(GL[AMT])*-1,
        FILTER(
            GL,
            GL[1_EXP]="EXP"
        )
    )

     

    Best Regards,
    Winniz