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
nielfxrm
Frequent Visitor

Cumulative sum with multiple filters

Hi,

 

I have created a running total DAX formula as below:

 

RunningTotal = 

CALCULATE( 
    SUM( Opportunity[Sales Price (DKK)] );
    FILTER( 
        ALLSELECTED( Opportunity );
        Opportunity[Close Date] <= MAX( Opportunity[Close Date] )
    )
)

That formula works. However, I would like to add the filter below as well - but I can't seem to get that working:

 Opportunity[Pipeline Category] = "Won" 

Any input is appreciated. 

 

1 ACCEPTED SOLUTION
PattemManohar
Community Champion
Community Champion

@nielfxrm Please try changing the SUM function inside the CALCULATE as below:

 

SUMX(FILTER(Opportunity,  Opportunity[Pipeline Category] = "Won"), Opportunity[Sales Price (DKK)])




Did I answer your question? Mark my post as a solution!

Proud to be a PBI Community Champion




View solution in original post

3 REPLIES 3
Ashukak
New Member

I tried to following  this  method but get an error

 

 

T1B Cumulative Total =
CALCULATE (
    SUMX(FILTER('VO Register (2)','VO Register (2)'[04 Goal]="Improve Downside (45Q)"),Timeline[T1.Mid Cu.EPV(m$)]);
           FILTER(
            ALLSELECTED('Timeline'[D. Progress to Implement Gate 3]),
            'Timeline'[D. Progress to Implement Gate 3]<= max(Timeline[D. Progress to Implement Gate 3]
        ))
 
Ashukak_0-1713278395721.png

If i remove the " ;" then it tells me the Fileter argument is incorrect

PattemManohar
Community Champion
Community Champion

@nielfxrm Please try changing the SUM function inside the CALCULATE as below:

 

SUMX(FILTER(Opportunity,  Opportunity[Pipeline Category] = "Won"), Opportunity[Sales Price (DKK)])




Did I answer your question? Mark my post as a solution!

Proud to be a PBI Community Champion




Thanks @PattemManohar. That did the job. 

 

I was trying to add the filter somewhere else in the formula.

 

Cheers. 

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.