cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

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

cumulate ok.png

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.

 

E4Ghhzt

The Dax is: 

 

 

 

 

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

 

 

 

 

 

Can someone help me?

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Cumulative Sum with Duplicate Date

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] )
            )
    )
)

 

7.jpg

 


Best regards,

 

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

View solution in original post

5 REPLIES 5
Highlighted
Super User IV
Super User IV

Re: Cumulative Sum with Duplicate Date

Your cumulative is for dates and does not include RAZAO SOCIAL, that is why you are getting that

 

Refer :https://community.powerbi.com/t5/Desktop/ALLEXCEPT-in-a-multitable-setup/td-p/403205

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution.
In case it does not help, please provide additional information and mark me with @

Thanks. My Recent Blogs -Decoding Direct Query - Time Intelligence, Winner Coloring on MAP, HR Analytics, Power BI Working with Non-Standard TimeAnd Comparing Data Across Date Ranges
Connect on Linkedin



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
My Recent Blog -Week is not so Weak Connect on Linkedin

Proud to be a Super User!

Highlighted
Community Support
Community Support

Re: Cumulative Sum with Duplicate Date

Hi @marcio_fornari ,

 

We can try to 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[RAZÃO SOCIAL] <= MAX(fDADOS[RAZÃO SOCIAL])
    )
)

 

5.jpg

 

 

If it doesn't meet your requirement, Could you please show the exact expected result based on the Tables that you have shared?


Best regards,

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Frequent Visitor

Re: Cumulative Sum with Duplicate Date

Hello, @v-lid-msft  Thanks for all. It's Almost

 

The Expected Result is:

 

cumulative.png

 

Highlighted
Community Support
Community Support

Re: Cumulative Sum with Duplicate Date

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] )
            )
    )
)

 

7.jpg

 


Best regards,

 

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

View solution in original post

Highlighted
Frequent Visitor

Re: Cumulative Sum with Duplicate Date

Hello @v-lid-msft 

Perfect! Thanks for All.

Helpful resources

Announcements
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

Community Blog

Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

Upcoming Events

Upcoming Events

Wondering what events you could join or have an event to promote yourself? Check out our Upcoming Events.

Community Summit Australia – Join Online!

Community Summit Australia – Join Online!

Be a part of the leading Microsoft Business Applications digital event, curated for the APAC community.

Top Solution Authors
Top Kudoed Authors