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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
nikkirai
Frequent Visitor

Calculate target and actual with cumulative sum

Hi all,

 

I have 2 tables: Target and Actual&Forecast. The Target table has a Date column and an ItemCount column. The Actual&Forecast has a Date column and an ItemCount column. I want to create a line graph that shows cumulative target item counts vs cumulative actual&forecast item counts on the y-axis and Date on the x-axis. 

 

The Target Line Graph is working fine with this:

Target Cumulative Sum  = CALCULATE(SUM('Target'[ItemCount]), FILTER(ALL('Target'), 'Target'[Date] <=max('Target'[Date])))

 

But I couldn't get the Actual&Forecast Line Graph to work with this:

Actual Cumulative Sum  = CALCULATE(SUM('ActualandForecast[ItemCount]), FILTER(ALL('ActualandForecast'), 'ActualandForecast'[Date] <=max('ActualandForecast'[Date])))

 

The Actual&Forecast line is showing more counts than target at a given date. How is this possible? How do you make the forecast part dotted line to separate from actual? Thank you for your help!

1 REPLY 1
v-zhangti
Community Support
Community Support

Hi, @nikkirai 

 

Can you provide sample data for testing? Sensitive information can be removed in advance. What kind of expected results do you expect? You can also show it with pictures or Excel. I look forward to your response.

 

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.