Forum Discussion

benjamin_berger's avatar
benjamin_berger
Frequent Visitor
4 years ago
Solved

Display Invoice Total on each line

I need to display the invoice total on each line, but needs to be relative to Invoice Number and Company. I cant figure it out. NEED HELP PLEASE!!!! For purposes of example, the data lives in a table called 'Table'

  • Hi benjamin_berger ,

     

    Create a column with below code:-

    Invoice_total = 
    CALCULATE (
        SUM ( 'Table (4)'[rev] ),
        FILTER (
            ALL ( 'Table (4)' ),
            'Table (4)'[Invoice number] = EARLIER ( 'Table (4)'[Invoice number] )
                && 'Table (4)'[Company] = EARLIER ( 'Table (4)'[Company] )
        )
    )

    Output:-

    Thanks,

    Samarth

2 Replies

  • Samarth_18's avatar
    Samarth_18
    Community Champion

    Hi benjamin_berger ,

     

    Create a column with below code:-

    Invoice_total = 
    CALCULATE (
        SUM ( 'Table (4)'[rev] ),
        FILTER (
            ALL ( 'Table (4)' ),
            'Table (4)'[Invoice number] = EARLIER ( 'Table (4)'[Invoice number] )
                && 'Table (4)'[Company] = EARLIER ( 'Table (4)'[Company] )
        )
    )

    Output:-

    Thanks,

    Samarth