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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
619SK
Helper II
Helper II

Cumulative formula in Power query

Data in power bi i'm having is  Daily count and Monthly target 50. Here i want to calculate Target value with difference of Prev  day count. so as per below example.  June target is 50.   and 1st June count completed is 2 so target on 2nd June will be 48 . 

After acheiving i will show line chart.

 

 

DateActual TargetTargetProjected
01-06-20242505
02-06-202410485
03-06-20242385
04-06-20245365
05-06-20245315
06-06-202410265
07-06-20244165
08-06-20244125
09-06-2024485
10-06-2024445
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @619SK ,

Thank you @Ashish_Mathur and @rajendraongole1  very much for the solution, and I've tried other ways to help you understand the problem:

We can add a COLUMN to your data to accomplish your goal.

column = 
VAR monthly = 50 

VAR  cumu =CALCULATE(SUM('Table'[Actual Target]),FILTER('Table','Table'[Date]<EARLIER('Table'[Date])
))
RETURN
monthly -cumu

vxingshenmsft_1-1719814170972.png

Hope it helps!

 

Best regards,
Community Support Team_ Tom Shen

 

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

 

 

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @619SK ,

Thank you @Ashish_Mathur and @rajendraongole1  very much for the solution, and I've tried other ways to help you understand the problem:

We can add a COLUMN to your data to accomplish your goal.

column = 
VAR monthly = 50 

VAR  cumu =CALCULATE(SUM('Table'[Actual Target]),FILTER('Table','Table'[Date]<EARLIER('Table'[Date])
))
RETURN
monthly -cumu

vxingshenmsft_1-1719814170972.png

Hope it helps!

 

Best regards,
Community Support Team_ Tom Shen

 

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

 

 

Ashish_Mathur
Super User
Super User

Hi,

Will the opening target always be a fixed number i.e. 50 or will this come from another table?  If it will, then share that table as well.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
rajendraongole1
Super User
Super User

Hi @619SK -I have tried to create a measure will calculate the cumulative sum of the actual daily using DAX, instead of PQ.

 

Measure as below:

 

Cumulative Actuals =
CALCULATE(
SUM('Table'[Actual Target]),
FILTER(
ALL('Table'[Date]),
'Table'[Date] <= MAX('Table'[Date])
)
)

 

create another measure that will calculate the remaining target by subtracting the cumulative actuals

 

Remaining Target =
VAR MonthlyTarget = 50 
RETURN
MonthlyTarget - [Cumulative Actuals]

 

as you mentioned a fixed value of 5, so create another constant measure.

Projected = 5

 

add it in your line chart and check the cumulative dynamically calculate the remaining target.

 

Hope it works.

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors
Top Kudoed Authors