Forum Discussion

Ramenboi11's avatar
Ramenboi11
New Member
1 year ago
Solved

Cumulative Measure

I have a column of an original budget revenue which I want to sum cumulatively with a column of budget change orders for each month, I can't find any helpful Formulas.   I can't show the real data ...
  • techies's avatar
    1 year ago

    Hi Ramenboi11 can you please check if this is as required

     

    Cumulative Budget =
    VAR SelectedDate = MAX('Date'[Date])
    VAR InitialBudget =
        CALCULATE(
            MAX(BudgetData[OriginalBudget]),
            FILTER(
                ALL(BudgetData),
                NOT(ISBLANK(BudgetData[OriginalBudget]))
            )
        )
    VAR TotalChange =
        CALCULATE(
            SUM(BudgetData[ChangeOrder]),
            FILTER(
                ALL('Date'),
                'Date'[Date] <= SelectedDate
            )
        )
    RETURN
        InitialBudget + TotalChange
     

     

  • rohit1991's avatar
    1 year ago

    Hi Ramenboi11 

    To calculate the cumulative budget in Power BI, you need to start by identifying the original budget amount, which typically appears only once (often at the start or in a separate row).

    Then, create a DAX measure that adds this original budget to the cumulative sum of monthly change orders. This can be done by using a measure that retrieves the maximum original budget from non-blank and non-zero entries, and then another measure that sums the change orders up to the current month.

     

    To ensure proper ordering, especially if your month column is text (like "Jan", "Feb"), create a separate column that assigns a numerical value to each month and use it to sort the visual.

    The final measure will calculate the cumulative budget by adding the initial budget to the sum of all change orders up to the selected month, allowing you to track how your budget evolves over time.