Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago

Sum Over Interval in Two Columns

Hi there! 

 

I have a database that show me some ongoing and scheduled processes, how many goods are being used, start month and end month of every process. Most of them take about 3 months to complete, and I need a measure to sum how many materials are being used per specific month.

 

I tried using CALCULATE ( SUM (), FILTER), I can make it sum everything in the start and end months, but I wasn't able to make PowerBI sum everything in between. So if it starts in Jan and ends in March, it gotta sum it in Feb as well. 

 

E.g.:

JanFebMarAprMayJune
100102108100111130

 

Does anyone know any content that can help me solve this?

 

Thanks!

3 Replies

  • tamerj1's avatar
    tamerj1
    Community Champion

    Anonymous 

    Not sure if I fully understand but did you with simple SUM. As I did not understand the use of FILTER

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous 

    So, what does the result you want to achieve look like ? Could you describe the result you want through formulas or specific data , maybe this will help us solve the problem better.

     

    Best Regards,
    Community Support Team _ Ailsa Tao
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Anonymous ,

       

      This is the real database below. The third column is the quantitites I need to sum. The #5 is the starting month and #6 is the end month. 

       

      I have this table that shows me, per month, the sum of everything coming back and everything leaving my warehouse. Now I would like to add a third column with Total Out of Stock. So, if a material is taken in May-2022 and is returned in July-2022, it should be summed in May, June and July (where I marked the X below).

      And I have no clue of how to create this measure. The interval is defined by those 2 columns above. 

      Thanks!