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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

Reply
RossP
Advocate I
Advocate I

Cumulative count

Hi,

 

I have a cumulative count that is working except when the number is the same the next row, this is my DAX:

 

 

cumulative total3 = 
var refArrivals = SUM(Query1[Arrivals])
return
CALCULATE(
    SUM(Query1[Arrivals]),
    FILTER(
        ALLSELECTED(Query1[ReferralSource]),
        CALCULATE(SUM(Query1[Arrivals]) >= refArrivals
        )
    ))

 

 

 
This is the output split by a ReferralSource Row. As you can see it works up until the number is the same and doesnt add it. Any ideas?
Thanks
RossP_1-1643286255841.png

 


 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@RossP , Try like

cumulative total3 =
var refArrivals = SUM(Query1[Arrivals])
return
CALCULATE(
SUM(Query1[Arrivals]),
FILTER(
ALLSELECTED(Query1[ReferralSource]),
Query1[ReferralSource] <= max(Query1[ReferralSource])
)
)

 

or

 


cumulative total3 =
var refArrivals = Summarize(Query1, Query1[ReferralSource]), "_sum" SUM(Query1[Arrivals]))
return
sumx(filter( refArrivals, [_sum]< = maxx( refArrivals,[_sum])),[_sum])

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@RossP , Try like

cumulative total3 =
var refArrivals = SUM(Query1[Arrivals])
return
CALCULATE(
SUM(Query1[Arrivals]),
FILTER(
ALLSELECTED(Query1[ReferralSource]),
Query1[ReferralSource] <= max(Query1[ReferralSource])
)
)

 

or

 


cumulative total3 =
var refArrivals = Summarize(Query1, Query1[ReferralSource]), "_sum" SUM(Query1[Arrivals]))
return
sumx(filter( refArrivals, [_sum]< = maxx( refArrivals,[_sum])),[_sum])

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

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