Forum Discussion

marcio_fornari's avatar
marcio_fornari
Icon for Resolver I rankResolver I
6 years ago
Solved

Cumulative Sum with Duplicate Date

Hello, I have a problem to sum a Cumulative Measure. 

Maybe this is happening because there duplicate Dates? 

 

If don't have duplicate dates: It's OK

But, if have a "RAZAO SOCIAL" value in the table, some date is duplicate, it's ok, but the Cumulative sum It's not ok.

 

The Dax is: 

 

 

 

 

Acumulado Saldo = 
CALCULATE(
    [Saldo do Dia];
    FILTER(
        All(fDADOS); fDADOS[DATA VENCIMENTO] <= MAX(fDADOS[DATA VENCIMENTO])
    )
)

 

 

 

 

 

Can someone help me?

Thanks

  • v-lid-msft's avatar
    v-lid-msft
    6 years ago

    Hi marcio_fornari ,

     

    Sorry for our mistake in the formula, we can use the following measure to meet your requirement:

     

    Acumulado Saldo =
    CALCULATE (
        [Saldo do Dia];
        FILTER (
            ALL ( fDADOS );
            fDADOS[DATA VENCIMENTO] < MAX ( fDADOS[DATA VENCIMENTO] )
                || (
                    fDADOS[DATA VENCIMENTO] = MAX ( fDADOS[DATA VENCIMENTO] )
                        && fDADOS[RAZÃO SOCIAL] <= MAX ( fDADOS[RAZÃO SOCIAL] )
                )
        )
    )
    

     

     


    Best regards,

     

6 Replies