Forum Discussion
Simple Cumulative Total with a measure
- 6 years ago
Hi Simao_Coimbra ,
Please refer to my sample.
I have a table like this.
Then I created a calculated column.
// It's best to use [MonthNo], because [Month] is text type data, we can't sort it. Month = [Date].[MonthNo]Then I created a meaure.
Cum = CALCULATE( [HF_Mes], FILTER( ALLSELECTED(Sheet1), Sheet1[Month] <= MAX(Sheet1[Month]) ) )Best regards,
Lionel ChenIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Simao_Coimbra , Try with a date calendar
Cumm = CALCULATE([HF_MES],filter(date,date[date] <=maxx(date,date[date])))
Cumm = CALCULATE([HF_MES],filter(date,date[date] <=max(TABLE[Date])))
To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions
https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi
https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/
See if my webinar on Time Intelligence can help: https://community.powerbi.com/t5/Webinars-and-Video-Gallery/PowerBI-Time-Intelligence-Calendar-WTD-YTD-LYTD-Week-Over-Week/m-p/1051626#M184
Appreciate your Kudos.
- Simao_Coimbra6 years agoFrequent Visitor
Hi amitchandak .
I already tried your purposed solution and it didn't work. I get the same result of the first column and not the accumulate.- amitchandak6 years ago
Super User
Simao_Coimbra ,Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.
- Simao_Coimbra6 years agoFrequent Visitor
Thank you for your patience
I have a lot of data but in short, this is it:With this, I would like to have the average of the sum of chilling hours per month from October to April, so I used the first measure and would like to see a graph with these accumulated values.
Once again thank you very much
Date Chilling Hours 02/01/1985 6.87235759717314 03/01/1985 5.05843347046371 17/02/1985 0 18/02/1985 2.59814757763975 14/03/1985 6.4112 15/03/1985 1.55136513288706 16/03/1985 4.74383499934762 17/03/1985 3.91264422938577 18/03/1985 3.47041640814479 19/03/1985 0 20/03/1985 0 21/03/1985 0 14/03/1985 6.4112 15/03/1985 1.55136513288706 16/03/1985 4.74383499934762 17/03/1985 3.91264422938577 18/03/1985 3.47041640814479 19/03/1985 0 20/03/1985 0 21/03/1985 0 28/05/1985 0 29/05/1985 0 30/05/1985 0 31/05/1985 0 01/06/1985 0 02/06/1985 0 03/06/1985 0 25/07/1985 0 26/07/1985 0 27/07/1985 0 28/07/1985 0 29/07/1985 0 30/07/1985 0 31/07/1985 0 01/08/1985 0 02/08/1985 0 03/08/1985 0 04/08/1985 0 05/08/1985 0 06/08/1985 0 07/08/1985 0 08/08/1985 0 09/08/1985 0 10/08/1985 0 26/08/1985 0 27/08/1985 0 28/08/1985 0 29/08/1985 0 30/08/1985 0 31/08/1985 0 01/09/1985 0 02/09/1985 0 03/09/1985 0 04/09/1985 0 05/09/1985 0 06/09/1985 0 07/09/1985 0 08/09/1985 0 26/10/1985 0 27/10/1985 0 28/10/1985 3.83983833057834 29/10/1985 0 30/10/1985 0 31/10/1985 0 14/11/1985 0 15/11/1985 3.64104139941691 21/12/1985 5.38914614003591 22/12/1985 0 23/12/1985 0 24/12/1985 0 27/01/1996 0 28/01/1996 0 29/01/1996 0 30/01/1996 0 31/01/1996 0 01/02/1996 0 02/02/1996 0 03/02/1996 0 04/02/1996 4.61236428571429 05/02/1996 0 06/02/1996 0 07/02/1996 0 08/02/1996 0.664657268722467 09/02/1996 0 10/02/1996 2.56567463333822 17/04/1996 0 18/04/1996 1.63002184115196 19/04/1996 0 20/04/1996 0 27/05/1996 0 28/05/1996 0 29/05/1996 0 30/05/1996 0 31/05/1996 0 01/06/1996 0 02/06/1996 0 03/06/1996 0 04/06/1996 0 05/06/1996 0 06/06/1996 0 07/06/1996 0 08/06/1996 0 09/06/1996 0 10/06/1996 0 11/06/1996 0 12/06/1996 0 13/06/1996 0 14/06/1996 0 15/06/1996 0 16/06/1996 0