Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago

Cumulative Sum except specific ID

Hi,

I have two table in power bi,

Table 1

Table 2

I am calculating the cumulative sum of amount from table, on 23-Nov-2023 the sum of Amount is 83974 with ID[1,2,3,4] but the sum of ID 2 is 0, Now in the table 2 I want the sum of all ID's which are filtered in table 1 but except the one with sum as 0.

so the Table 2 Sum for ID [1,2,3,4] is 146447 and ID 2 Sum is 51454, so it should excude the ID 2 and give the sum like 146447 - 51454 = 94993

 

Thanks

 

2 Replies

  • Hi,

    I am not sure how your semantic model looks like, but I tried to create a sample pbix file like below.

    Please check the below picture and the attached pbix file.

    All DAX measures are in the pbix file, and I hope the below can provide some ideas on how to create a solution for your semantic model.

     

     

     

     

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi,

      I have tried your measure in line graph it is showing constant value for all dates,

      on date 9/5/2023 the measure Result Sum and ID exclude value should be 7018 and and the cumulative sum should be 14053.

       

      Thanks