Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Pepperi
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
Zubair_Muhammad
Community Champion
Community Champion

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

Regards
Zubair

Please try my custom visuals

View solution in original post

2 REPLIES 2
Zubair_Muhammad
Community Champion
Community Champion

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

Regards
Zubair

Please try my custom visuals

Hi @Zubair_Muhammad,

 

Thanks a lot, it works fine!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.