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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
July 2024 Power BI Update

Power BI Monthly Update - July 2024

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

July Newsletter

Fabric Community Update - July 2024

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

Top Solution Authors