Forum Discussion
How to compute GL Expense average 12 month amount ?
- 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,
WinnizIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- 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
Hi admin11 ,
Try the following formula:
avg =
-AVERAGEX(
FILTER(
'Table',
'Table'[YrMth Sort] >= EOMONTH( LASTDATE( ALL( 'Table'[YrMth Sort] ) ), -12 )
),
[Amount]
)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.
Thank you very much for sharing.
i try to implement your expression to my PBIX file , i don't have error , but it display blank.
Paul
- v-kkf-msft5 years ago
Community Support
Hi admin11 ,
That should be caused by different model. Can you share your PBIX file? The previous link shows that the file has been deleted.
Best Regards,
Winniz
- admin115 years ago
Memorable Member
- v-kkf-msft5 years ago
Community Support
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,
WinnizIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.