Forum Discussion

CraigMFuso's avatar
CraigMFuso
Frequent Visitor
6 years ago
Solved

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. 

 

 

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

 

 

Table of results showing issue

 

 

 

 

 

  • 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.

4 Replies

    • CraigMFuso's avatar
      CraigMFuso
      Frequent Visitor

      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

       

      • v-xuding-msft's avatar
        v-xuding-msft
        Community Support

        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.