• Can you share your complete query?

    It sounds like you are doing something like this:

    SELECT

    I.*,

    SUM(final) OVER(PARTITION BY InvoiceNmbr) AS invoicedTotal

    FROM

    dbo.invoices AS I

    WHERE

    I.USER = 'jsmith';

    But there are rows for an InvoiceNmbr by multiple users and when you run the query, you expect to see the total for the invoice number, while only showing details for the specific user. I think you need something like this:

    SELECT

    I.*,

    TI.invoicedTotal

    FROM

    dbo.invoices AS I CROSS APPLY

    (

    SELECT SUM(final) AS invoicedTotal FROM dbo.invoices AS TI WHERE I.InvoiceNmber = I2.InvoiceNmbr

    ) AS TI

    WHERE

    I.USER = 'jsmith';