cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Samarth-Borade
Frequent Visitor

Revverse cumulative error

RevCum_Revenue123 = VAR RunningTotal= CALCULATE([sss], FILTER(ALL(grp[Rev]),grp[Rev]>=MIN(grp[Rev])))
RETURN IF(ISBLANK([sss]),BLANK(),RunningTotal)
 
here [sss] = SUM(grp[Rev])
 
SamarthBorade_0-1675330670841.png
when i remove customer code, it will only show the entire sum.I want to show the reverse cumulative ,
i.e in descending  order: 9031 then 9031+8984 then 9031+8984+4792.
1 ACCEPTED SOLUTION

@Samarth-Borade 
Please refer to attached sample file with the proposed solution

1.png

RevCum_Revenue = 
VAR CurrentRevenue = 
    SUM ( 'Table'[Revenu] )
VAR T1 = 
    SELECTCOLUMNS ( 
        ALLSELECTED ( 'Table'[Customer Cod] ),
        "@Revenue", CALCULATE ( SUM ( 'Table'[Revenu] ) )
    )
VAR T2 = 
    FILTER ( T1, [@Revenue] >= CurrentRevenue )
RETURN
    SUMX ( T2, [@Revenue] )

View solution in original post

4 REPLIES 4
tamerj1
Super User
Super User

Hi @Samarth-Borade 
What is the result that you're looking for?

Any leads?

 

SamarthBorade_0-1675335927635.png

 

@Samarth-Borade 
Please refer to attached sample file with the proposed solution

1.png

RevCum_Revenue = 
VAR CurrentRevenue = 
    SUM ( 'Table'[Revenu] )
VAR T1 = 
    SELECTCOLUMNS ( 
        ALLSELECTED ( 'Table'[Customer Cod] ),
        "@Revenue", CALCULATE ( SUM ( 'Table'[Revenu] ) )
    )
VAR T2 = 
    FILTER ( T1, [@Revenue] >= CurrentRevenue )
RETURN
    SUMX ( T2, [@Revenue] )

Helpful resources

Announcements
May 2023 update

Power BI May 2023 Update

Find out more about the May 2023 update.

Submit your Data Story

Data Stories Gallery

Share your Data Story with the Community in the Data Stories Gallery.

Top Solution Authors