Forum Discussion
Cumulative sum two dates condition
Hi all,
I am trying to add cumulative sum based on two different dates. I have example data like below:
| Value | Ready Date | Implement Date |
| 1 | Dec 2023 | Dec 2023 |
| 3 | Dec 2023 | Dec 2023 |
| 5 | Dec 2023 | Dec 2024 |
| 7 | Dec 2023 | Dec 2025 |
After cumulative sum based on date it should be like
| Year | Cumulative Ready | Cumulative Implement |
| 2023 | 16 | 4 |
| 2024 | 16 | 9 |
| 2025 | 16 | 16 |
I try using the usual sum date <= max date but to no avail. Please help. Thanks.
It works now I figured it out by linking the two dates column to a new date table. Then I use USERELATIONSHIP as filter and pass into the filter. Thank you for your help regardless.
3 Replies
- Jihwan_Kim
Super User
Hi,
I am not sure if I understood your question correctly, or I do not know how your semantic model looks like, but please check the below picture and the attached pbix file.
expected result measure 1: = CALCULATE ( SUM ( data[Value] ), REMOVEFILTERS ( 'Calendar' ) )expected result measure 2: = CALCULATE ( SUM ( data[Value] ), 'Calendar'[Date] <= MAX ( 'Calendar'[Date] ) )- Commonq1234Frequent Visitor
Hi, thanks for the response.
I think not quite, I may have provided the ready date as the same; however, as I need each date column to act as the condition. For example data below:
alue Ready Date Implement Date 1 Dec 2023 Dec 2023 3 Dec 2023 Dec 2023 5 Dec 2024 Dec 2024 7 Dec 2024 Dec 2025 Expected result should be
Is there a way to cumulative each sum based on the date column it's corresponded to? Thanks
Year Cumulative Ready Cumulative Implement 2023 4 4 2024 16 9 2025 16 16
- Commonq1234Frequent Visitor
It works now I figured it out by linking the two dates column to a new date table. Then I use USERELATIONSHIP as filter and pass into the filter. Thank you for your help regardless.