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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Running Total on two sets of Data

Hi, im new to Power Bi .

Im trying to generate an S-Curve for resources.

Budget VS Actual using a stacked bar with line for cumulative Units a running total for each.

Im trying to get a running total for Budgeted Units  VALUES and a second one for Actual Units VALUES.

Zl_0-1660798733074.png

Zl_1-1660798750803.png

 

 

With an end result with both sets of values on the chart.

 

Zl_2-1660798796259.png

 

Thanks in advance 🙂

 

 

2 ACCEPTED SOLUTIONS
v-jingzhang
Community Support
Community Support

Hi @Anonymous

 

You can create two measures in the model to calculate the running totals for actual and budget values separately. Add both to Line y-axis on the visual. 

Running Total of Actual =
CALCULATE (
    SUM ( SampleTable[Value] ),
    ALLSELECTED ( SampleTable[Date] ),
    SampleTable[Date] <= MAX ( SampleTable[Date] ),
    SampleTable[Spreadsheet Field] = "Actual Units"
)
Running Total of Budget =
CALCULATE (
    SUM ( SampleTable[Value] ),
    ALLSELECTED ( SampleTable[Date] ),
    SampleTable[Date] <= MAX ( SampleTable[Date] ),
    SampleTable[Spreadsheet Field] = "Budgeted Units"
)

vjingzhang_0-1661159306569.png

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

View solution in original post

Hi @Anonymous 

 

Use this measure for actual units. 

Running Total of Actual = 
VAR lastActualDate =
    CALCULATE (
        MAX ( SampleTable[Date] ),
        ALLSELECTED ( SampleTable[Date] ),
        SampleTable[Spreadsheet Field] = "Actual Units"
    )
RETURN
    IF (
        MAX ( SampleTable[Date] ) <= lastActualDate,
        CALCULATE (
            SUM ( SampleTable[Value] ),
            ALLSELECTED ( SampleTable[Date] ),
            SampleTable[Date] <= MAX ( SampleTable[Date] ),
            SampleTable[Spreadsheet Field] = "Actual Units"
        ),
        BLANK ()
    )

vjingzhang_0-1661224180159.png

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

View solution in original post

7 REPLIES 7
Anonymous
Not applicable

Is there a way of adapting the expression to have it as a percentage of total units? 

 

Planned % complete Vs Actual % of complete.

 

 

 

Hi @Anonymous 

What should be the total (denominator) on every date? 

Planned % of complete = (?) / (?)

Anonymous
Not applicable

Zl_1-1663220240211.png

 

Hope this helps.

 

Is it possible as before to stop the Actual % Running only to the max date to prevent the flat cumulative line?

 

Thanks in advance ,

 

Really appreciate it.

 

 

v-jingzhang
Community Support
Community Support

Hi @Anonymous

 

You can create two measures in the model to calculate the running totals for actual and budget values separately. Add both to Line y-axis on the visual. 

Running Total of Actual =
CALCULATE (
    SUM ( SampleTable[Value] ),
    ALLSELECTED ( SampleTable[Date] ),
    SampleTable[Date] <= MAX ( SampleTable[Date] ),
    SampleTable[Spreadsheet Field] = "Actual Units"
)
Running Total of Budget =
CALCULATE (
    SUM ( SampleTable[Value] ),
    ALLSELECTED ( SampleTable[Date] ),
    SampleTable[Date] <= MAX ( SampleTable[Date] ),
    SampleTable[Spreadsheet Field] = "Budgeted Units"
)

vjingzhang_0-1661159306569.png

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

Anonymous
Not applicable

Thank you so much :).

 

Is there a way i can modify the code to stop the code from running for the actual units up to a certain date? so i can prevent the to prevent the flat line afterwards. To Try and show a tracking line Budget VS Actual?

 

 

 

Zl_0-1661219036580.png

Zl_1-1661219836410.png

 

 

Hi @Anonymous 

 

Use this measure for actual units. 

Running Total of Actual = 
VAR lastActualDate =
    CALCULATE (
        MAX ( SampleTable[Date] ),
        ALLSELECTED ( SampleTable[Date] ),
        SampleTable[Spreadsheet Field] = "Actual Units"
    )
RETURN
    IF (
        MAX ( SampleTable[Date] ) <= lastActualDate,
        CALCULATE (
            SUM ( SampleTable[Value] ),
            ALLSELECTED ( SampleTable[Date] ),
            SampleTable[Date] <= MAX ( SampleTable[Date] ),
            SampleTable[Spreadsheet Field] = "Actual Units"
        ),
        BLANK ()
    )

vjingzhang_0-1661224180159.png

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

Anonymous
Not applicable

Thank You so much 🙂

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.