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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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