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

Data Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more

Reply
samc_26
Helper IV
Helper IV

Cumulative target by day and month

Hi, I have a table which look a bit like this and I need it to show the target value cumulatively but going from 0 at the start of the month to the target at the end of the month as shown in the last column. If anyone can help me please it would be much appreciated! I also have a date table with YYYY-MM and dates if that's any help!

 

N.B. I don't need it to show the target as shown in the middle column, this is just to show the raw data.

 

Thank you for reading! 

 

DateTargetCumulative target
01/01/251003.2
02/03/2506.4
03/01/2509.6
...0...
31/01/250100
1 ACCEPTED SOLUTION
Selva-Salimi
Solution Sage
Solution Sage

hi @samc_26 ,

 

you can write a column for year_month as follows:

year_month = FORMAT('Table'[Date],"YYYYMM")

 

and then add another column like this:

 

Column = var sum_target = CALCULATE(SUM('Table'[Target]),FILTER('Table','Table'[year_month]=EARLIER('Table'[year_month])))
var days_count = CALCULATE(DISTINCTCOUNT('Table'[Date]),FILTER('Table','Table'[year_month]=EARLIER('Table'[year_month])))
var dc = CALCULATE(DISTINCTCOUNT('Table'[Date]),FILTER('Table','Table'[Date] <=EARLIER('Table'[Date]) && 'Table'[year_month]=EARLIER('Table'[year_month])))
var cumulative_target = sum_target/days_count *dc
return
cumulative_target
 
If this post helps, then I would appreciate a thumbs up 👍 and mark it as the solution to help the other members find it more quickly.

 

 

View solution in original post

3 REPLIES 3
Selva-Salimi
Solution Sage
Solution Sage

hi @samc_26 ,

 

you can write a column for year_month as follows:

year_month = FORMAT('Table'[Date],"YYYYMM")

 

and then add another column like this:

 

Column = var sum_target = CALCULATE(SUM('Table'[Target]),FILTER('Table','Table'[year_month]=EARLIER('Table'[year_month])))
var days_count = CALCULATE(DISTINCTCOUNT('Table'[Date]),FILTER('Table','Table'[year_month]=EARLIER('Table'[year_month])))
var dc = CALCULATE(DISTINCTCOUNT('Table'[Date]),FILTER('Table','Table'[Date] <=EARLIER('Table'[Date]) && 'Table'[year_month]=EARLIER('Table'[year_month])))
var cumulative_target = sum_target/days_count *dc
return
cumulative_target
 
If this post helps, then I would appreciate a thumbs up 👍 and mark it as the solution to help the other members find it more quickly.

 

 

Thank you very much @Selva-Salimi , this worked great! 🙌

ajaybabuinturi
Resident Rockstar
Resident Rockstar

Hi @samc_26,

I am little bit consfusing about your query, could you please provide .pbix file along with expected result. So that I can try to provide the solution. 

Use any cloud platform to provide file and add that url(public access) here by using insert link.

Thanks,
If you found this solution helpful, please consider giving it a Like👍 and marking it as Accepted Solution✔. This helps improve visibility for others who may be encountering/facing same questions/issues.


 

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.