Forum Discussion

edavis248's avatar
edavis248
Icon for Helper I rankHelper I
3 years ago
Solved

Remaining value count

Hi all-   I have contract values for the same contracts. The contract value shows the same value over and over as it is the same contract for each invoice. I need to create a column that takes the ...
  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi edavis248 ,

     

    Do you mean that when this column "What I want to show (remaining)" is negative, it also outputs 0? If yes, we can create a column.

    What I want to show(remaining) = 
    var a= CALCULATE(SUM('BGE_INVOICES'[Contract amount]),FILTER('BGE_INVOICES','BGE_INVOICES'[Index]=1))
    var b=SUMX(FILTER('BGE_INVOICES','BGE_INVOICES'[Contract ID]=EARLIER('BGE_INVOICES'[Contract ID])&&'BGE_INVOICES'[Index]<=EARLIER('BGE_INVOICES'[Index])),'BGE_INVOICES'[Invoice amount])
    return 
    IF((a-b)>=0,(a-b),0)

    I don't think I'm very clear about your new needs, my suggestion is that you mark the answer to the current post as a solution and recreate the post to describe the other needs in detail, thank you for your time.

     

    Best Regards,

    Neeko Tang

    If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly.