Forum Discussion
Simple Cumulative Total with a measure
Hello everyone,
I need some help that I think will be quite simple, but I'm not getting it.
I have a measure called "HF_Mes", that returns the average chilling hours per month.
Ex: Nov: 3.1+ 34.07
...
Thank you very much in advance
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.
6 Replies
- amitchandak
Super User
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_CoimbraFrequent 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.- amitchandak
Super User
Simao_Coimbra ,Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.
- v-lionel-msft
Community Support
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_CoimbraFrequent Visitor
Thank you v-lionel-msft a lot. It worked perfectly!