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

Keep cumulative in column, not as a measure

Hello,

 

I have a table of deals, which contains all the deals with the date, the amount, the customer names (ParentAccountId).

 

I already created a "Cumulated" measure that works fine (orange and blue in the screenshot below). However, i want to create a column that will keep, for each customer, the related cumulated amount for all the deals closed before the deal's date.

For this purpose, I created a column:

Column = CALCULATE(SUMX(OPPORTUNITY,OPPORTUNITY[Amount USD]),FILTER(OPPORTUNITY,OPPORTUNITY[DEAL DATE]<=EARLIER(OPPORTUNITY[DEAL DATE]))

This column seems to indeed calculate the cumulated, but for all parent accounts, and not only the related customer, as it shows in red in the screenshot (it shows the table for 2 customers only, that's why the numbers are big).

Do you have an idea?

 

Thanks ahead!

Screenshot_2.png

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User III
Super User III

Re: Keep cumulative in column, not as a measure

HI @Pepperi

 

Try this

 

Column =
CALCULATE (
    SUMX ( OPPORTUNITY, OPPORTUNITY[Amount USD] ),
    FILTER (
        OPPORTUNITY,
        Opportunity[ParentAccountId] = EARLIER ( Opportunity[ParentAccountId] )
            && OPPORTUNITY[DEAL DATE] <= EARLIER ( OPPORTUNITY[DEAL DATE] )
    )
)
Try my new Power BI game Cross the River

View solution in original post

2 REPLIES 2
Highlighted
Super User III
Super User III

Re: Keep cumulative in column, not as a measure

HI @Pepperi

 

Try this

 

Column =
CALCULATE (
    SUMX ( OPPORTUNITY, OPPORTUNITY[Amount USD] ),
    FILTER (
        OPPORTUNITY,
        Opportunity[ParentAccountId] = EARLIER ( Opportunity[ParentAccountId] )
            && OPPORTUNITY[DEAL DATE] <= EARLIER ( OPPORTUNITY[DEAL DATE] )
    )
)
Try my new Power BI game Cross the River

View solution in original post

Highlighted
Frequent Visitor

Re: Keep cumulative in column, not as a measure

Hi @Zubair_Muhammad,

 

Thanks a lot, it works fine!

Helpful resources

Announcements
May 2020 Community Highlights

May 2020 Community Highlights

It’s time for another PBI Community recap!

Community Blog

Community Blog

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

Using the Community

Using the Community

Need help with the Power BI Community? Our 'Using the Community' support articles are a great place to start.

Galleries

Galleries

Looking for inspiration on how to present your data? Need instructional videos? Check out our Galleries!

Top Solution Authors