Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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
Above my PBI :-
Paul
Solved! Go to Solution.
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.
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 Paul,
try this measure
YTD Avg Expense = TOTALYTD(AVERAGE('GL'[AMT]),'Date'[Date])
But the result is vastly different to your 42952. How did you arrive at that value?
I can't work out how you are recording expenses. There are multiple columns in your GK table with the word EXP and another column with the Type E. Are these expenses?
Regards
Phil
Proud to be a Super User!
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
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
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.
For the above avg expression which is working fine . now i need to make use of filter panel , to filter to set 1_EXP=EXP.
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
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
97 | |
96 | |
81 | |
74 | |
66 |
User | Count |
---|---|
126 | |
105 | |
103 | |
81 | |
72 |