Forum Discussion
Cumulative total ignoring certain table columns
- 8 years ago
Hi koenmilt,
You could try this:
Cumulative Hours spend = CALCULATE ( SUM ( 'OVERUREN_WEEK'[Hours Spend] ), FILTER ( ALLEXCEPT ( 'OVERUREN_WEEK', OVERUREN_WEEK[Employee] ), OVERUREN_WEEK[Year_Week] <= MAX ( OVERUREN_WEEK[Year_Week] ) ) )Best regards,
Yuliana Gu
Hi koenmilt,
From the highlighted rows, we can see that the cumulative total for Henk in Year_week 201704 is reset, comparing with Year_week 201703.
For the error message, do you have multiple records for one employee under the same week?
Regards,
Yuliana Gu
Hi v-yulgu-msft,
I'm sorry, I probably did not explain well enough.
Indeed, it is reset. I am looking for a way in which the cumulative will NOT be reset in week 201704, even though the employee has a different cost center in that week.
The DAX which I described in my original post has the same behaviour as the one you suggest in your post.
- v-yulgu-msft8 years agoMicrosoft Employee
Hi koenmilt,
Based on the sample in my above post, what is your desired result? Could you illustrate your requirement with examples? If possible, please post an image.
Regards,
Yuliana Gu- koenmilt8 years agoFrequent Visitor
Hi v-yulgu-msft,
I'm having trouble uploading an image.The result I want is the following:
Employee - cost center - function - year_week - hours spend - cumulative
Henk - 2500 - Developer - 201701 - 3 - 3
Henk - 2500 - Developer - 201702 - 1 - 4
Henk - 4000 - Developer - 201703 - 2 - 6
Henk - 4000 - Consultant - 201704 - 3 - 9
Jan - 3000 - Manager - 201701 - 1 - 1
Jan - 3000 - Manager - 201702 - 2 - 3
Thus, the cumulative only breaks by employee. As I showed in the previous post, currently the cumulative also breaks by Cost_center and function, wich means the cumulative resets when Henk switches to a different cost center in week 201703.
- v-yulgu-msft8 years agoMicrosoft Employee
Hi koenmilt,
You could try this:
Cumulative Hours spend = CALCULATE ( SUM ( 'OVERUREN_WEEK'[Hours Spend] ), FILTER ( ALLEXCEPT ( 'OVERUREN_WEEK', OVERUREN_WEEK[Employee] ), OVERUREN_WEEK[Year_Week] <= MAX ( OVERUREN_WEEK[Year_Week] ) ) )Best regards,
Yuliana Gu