Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago

Average Calculation for the over due amount

Hi All,

I am calculating the average for Owed_amt column but the average should be calculated for 12 months.

if data is available for 7 months then average will be calculated for 7 months

im not getting output correctly why??

Tables: Receivables, Master_Calender

Measure

AVG = CALCULATE(SUM(Receivables[OWED_AMT]),ALL(Master_Calender))/MAX([ZMONTH])


Any help is greatly appreciated.

Thanks!!

 

 

@amitchandak mwegener please suggest

 

1 Reply

  • Anonymous ,  try measure like

    Averagex(Values(Date[Month Year]) ,  CALCULATE(SUM(Receivables[OWED_AMT]))

     

     

    or

     

     

    12 Month Avg = CALCULATE(AverageX(Values('Date'[MONTH Year]),calculate(Sum(Receivables[OWED_AMT])))
    ,DATESINPERIOD('Date'[Date ],MAX('Date'[Date ]),-12,MONTH))

     

     

    Asummed that you are using date table join with date of your table