Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
CraigMFuso
Frequent Visitor

Cumulative Budget Error

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. 

 

Annotation 2020-04-20 095316 3.png

 

I have then created this cumulative measure which is were I am having an issue. 

 

Annotation 2020-04-20 094235 2.png

 

Table of results showing issue

 

Annotation 2020-04-20 094235.png

 

 

 

 

1 ACCEPTED 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.

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.

View solution in original post

4 REPLIES 4
Ashish_Mathur
Super User
Super User

Hi,

Try this measure

=CALCULATE([Budget Allocation],DATESYTD(Calendar,"31/12"))

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
edhans
Super User
Super User

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



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

Hi, 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:

 

 

DateBudget AllocationCumulative Budgets (current formula with issue)Cumulative Budgets (expected result)
01/01/2012,654.84392,300.1612,654.84
02/01/2012,654.84784,600.3225,309.68
03/01/2012,654.841,176,900.4837,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.

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.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.