Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hi all.
I am trying to calculate a cumulative budget however my result is not correct.
I have a budget allocation measure which is returning the correct result.
I have then created this cumulative measure which is were I am having an issue.
Table of results showing issue
Solved! Go to Solution.
Hi @CraigMFuso ,
Have you tried to split the measure of Cumulative Budgets?
Measure =
VAR __Table =
SUMMARIZE ( 'Calendar', 'Calendar'[Date], "Budgets", [Budget Allocation] )
RETURN
SUMX ( __Table, [Budgets] )
Cumulative Budgets =
CALCULATE (
[Measure],
FILTER (
ALL( 'Calendar' ),
'Calendar'[Date] <= MAX ( 'Calendar'[Date] )
)
)
Because of the measure of Total Dealer Budgets, I can't reproduce your problem. If the formulas above can't work, can you please share the formula of Total Dealer Budgets?
Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi,
Try this measure
=CALCULATE([Budget Allocation],DATESYTD(Calendar,"31/12"))
Hope this helps.
Someone else might be able to look at that and spot the error, but I'd need something to play with, and I cannot copy images of tables and measures into Power BI. Put measures in the code boxes (the </> icon in the toolbar) and tables via below link for sample data.
How to get good help fast. Help us help you.
How to Get Your Question Answered Quickly
How to provide sample data in the Power BI Forum
DAX is for Analysis. Power Query is for Data Modeling
Proud to be a Super User!
MCSA: BI ReportingHi, hope this helps.
Budget Allocation =
VAR MonthDays = CALCULATE( COUNTROWS( 'Calendar' ), ALL( 'Calendar'[Date] ), VALUES( 'Calendar'[Month & Year] ) )
VAR DailyBudget = CALCULATE( [Total Dealer Budgets], ALL( 'Calendar'[Date] ), VALUES( 'Calendar'[Month & Year] ) )
RETURN
IF( ISFILTERED( 'Calendar'[Date] ),
DIVIDE( DailyBudget, MonthDays, 0 ),
[Total Dealer Budgets] )
Cumulative Budgets = CALCULATE(
SUMX( SUMMARIZE( 'Calendar', 'Calendar'[Date], "Budgets", [Budget Allocation] ), [Budgets] ),
FILTER( ALLSELECTED( 'Calendar' ),
'Calendar'[Date] <= MAX( 'Calendar'[Date] )))
Results example:
Date | Budget Allocation | Cumulative Budgets (current formula with issue) | Cumulative Budgets (expected result) |
01/01/20 | 12,654.84 | 392,300.16 | 12,654.84 |
02/01/20 | 12,654.84 | 784,600.32 | 25,309.68 |
03/01/20 | 12,654.84 | 1,176,900.48 | 37,964.52 |
Hi @CraigMFuso ,
Have you tried to split the measure of Cumulative Budgets?
Measure =
VAR __Table =
SUMMARIZE ( 'Calendar', 'Calendar'[Date], "Budgets", [Budget Allocation] )
RETURN
SUMX ( __Table, [Budgets] )
Cumulative Budgets =
CALCULATE (
[Measure],
FILTER (
ALL( 'Calendar' ),
'Calendar'[Date] <= MAX ( 'Calendar'[Date] )
)
)
Because of the measure of Total Dealer Budgets, I can't reproduce your problem. If the formulas above can't work, can you please share the formula of Total Dealer Budgets?
Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
User | Count |
---|---|
140 | |
113 | |
104 | |
76 | |
63 |
User | Count |
---|---|
135 | |
126 | |
110 | |
70 | |
61 |