Forum Discussion

Commonq1234's avatar
Commonq1234
Frequent Visitor
2 years ago
Solved

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:

ValueReady DateImplement Date
1Dec 2023Dec 2023
3Dec 2023Dec 2023
5Dec 2023Dec 2024
7Dec 2023Dec 2025

After cumulative sum based on date it should be like 

YearCumulative ReadyCumulative Implement
2023164
2024169
20251616

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

  • 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] ) )

     

    • Commonq1234's avatar
      Commonq1234
      Frequent 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: 

      alueReady DateImplement Date
      1Dec 2023Dec 2023
      3Dec 2023Dec 2023
      5Dec 2024Dec 2024
      7Dec 2024Dec 2025

      Expected result should be  

      Is there a way to cumulative each sum based on the date column it's corresponded to? Thanks

      YearCumulative ReadyCumulative Implement
      202344
      2024169
      20251616
  • Commonq1234's avatar
    Commonq1234
    Frequent 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.