Forum Discussion
Detailed Budget Allocation Based on Actuals
- 1 year ago
Hi everyone,
I figured out the solution based on the concept of SQL view. I created a temporary view to be able to use SUMX.
Here is the final measure. Hope it helps other members or me in the future.
_DetailBudget =
var _table = FILTER(
SUMMARIZECOLUMNS(
'Month'[YearMonth], Account[Account], "Amount", MIN('Fact'[Amount]),
"_Multipler", DIVIDE(CALCULATE(sum('Fact'[Amount]), 'Fact'[Type] <> "Debit", ALL('Account')), CALCULATE(sum('Fact'[Amount]), 'Fact'[Type] <> "Credit", ALL('Account'))),
"_New", MIN('Fact'[Amount]) * DIVIDE(CALCULATE(sum('Fact'[Amount]), 'Fact'[Type] <> "Debit", ALL('Account')), CALCULATE(sum('Fact'[Amount]), 'Fact'[Type] <> "Credit", ALL('Account')))
)
,
Account[Account] <> "Budget")
RETURN
SUMX(_table, [_New])
Hi,
Share some data to work with and show the expected result very clearly. Share data in a format that can be pasted in an MS Excel file.
- katietran04671 year ago
Helper I
Hi Ashish_Excel
Here is the data
YearMonthAccountAmountType
202501 HR 23 Debit 202501 IT 15 Debit 202501 BD 54 Debit 202501 Budget 100 Credit 202502 HR 26 Debit 202502 IT 19 Debit 202502 BD 48 Debit 202502 Budget 95 Credit 202503 HR 17 Debit 202503 IT 36 Debit 202503 BD 45 Debit 202503 Budget 89 Credit And here is the expected outcome (red total figure)
- Ashish_Excel1 year ago
Solution Supplier
Cannot understand anything there.
- v-sgandrathi1 year ago
Community Support
Hi katietran0467,
Thank you for sharing the data and the expected outcome.
I'm attaching the .pbix file, please have a look and let me know if this aligns with what you were expecting.I hope this helped! Feel free to ask any further questions. If this resolved your issue, please mark it as "Accept as Solution" and give us Kudos to assist others.
Thank you.
- katietran04671 year ago
Helper I
Hi v-sgandrathi
Thanks for your time to investigate it.
I checked your file but the total number is still incorrect. The DetailedBudget should be equal to TotalBudget = 284 in total, not 569 as your file.
To work around, I created a view by SUMMARIZECOLUMN and put numbers to use SUMX.
If there is a way using DAX calculation without creating a view, it would be a better solution.