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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
RYU209
Helper III
Helper III

SUMX for cumulative sum not working as expected

Hello,

I'm trying to use SUMX to create a cumulative sum of a measure that counts the amount of distinct Projects. 

Currently I have a distinct incomplete Project count measure:

Incomplete Projects = 

CALCULATE(DISTINCTCOUNT(Table1[ProjectID]), Table1[ProjectStatus] IN {"PLN", "CUR", "ONH"})

I'm trying to view the cumulative sum of this measure over time using the following:

Cumulative Active Projects = SUMX('DateTable', [Incomplete Projects])

Here is my output:
RYU209_0-1699558613889.png

 

For some reason my Cumulative Active Projects measure is not adding up over time. What am I doing wrong here?

1 ACCEPTED SOLUTION
audreygerred
Super User
Super User

Hi! You can use a running total through quick meausures, or use the below DAX:

DistinctCount running total in Date =
CALCULATE(
    [Active Projects],
    FILTER(
        ALLSELECTED('Date'[Date]),
        ISONORAFTER('Date'[Date], MAX('Date'[Date]), DESC)
    )
)
 
audreygerred_0-1699559955366.png

 





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

Proud to be a Super User!





View solution in original post

5 REPLIES 5
audreygerred
Super User
Super User

Hi! You can use a running total through quick meausures, or use the below DAX:

DistinctCount running total in Date =
CALCULATE(
    [Active Projects],
    FILTER(
        ALLSELECTED('Date'[Date]),
        ISONORAFTER('Date'[Date], MAX('Date'[Date]), DESC)
    )
)
 
audreygerred_0-1699559955366.png

 





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

Proud to be a Super User!





Thank you @audreygerred, that worked perfectly. I'm still curious, though, why is my old measure not working?  

No problem! SUMX is an iterator function so it completes the summing at each row, then sums those up for a total, but it is not meant for cumulative or running total - just a row and total. Here is a blog I recently wrote abot iterators: http://powerbiwithme.com/2023/11/01/the-iterator-edition/ 





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

Proud to be a Super User!





OK, when I looked up similar questions to mine I saw many people using SUMX. Thank you for the explanation! 

Anytime! Thanks for asking!





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

Proud to be a Super User!





Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors