Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
How can I get the desired Cumulative Sum Column?
To be noted that The Location Count column result is calculated Measure and is not directly coming from a column
Solved! Go to Solution.
Hi @learner03,
After hours of research, I hope I have found the solution. Take note that is not my original. It is derived from the proposed solution of Ashish_Mathur on https://community.powerbi.com/t5/Desktop/Filtering-and-ADDCOLUMNS-field-containing-a-cumulative-sum-...
LocCount Rank =
RANKX ( ALL ( Data[Order Number] ), [Location sum],, ASC )
//Rank [Order Number] by Location count
Cumulative total =
SUMX (
TOPN (
[LocCount Rank],
CALCULATETABLE ( VALUES ( Data[Order Number] ), ALL ( Data[Order Number] ) ),
[LocCount Rank], ASC
),
[Sum of Value]
)
sample pbix - https://drive.google.com/file/d/1J_lt38GY3QhY2GJ_numIt7a37j_IBWMl/view?usp=sharing
Hi @learner03 ,
Below are example formula on how to calculate cumulative value. The calculation is based on the alphabetical sorting of order number column.
Cumulative Value - Measure =
CALCULATE (
SUM ( Data[Value] ),
FILTER ( ALL ( Data ), Data[Order Number] <= MAX ( Data[Order Number] )
)
)
Cumulative Value - Column =
CALCULATE (
SUM ( Data[Value] ),
FILTER ( ALL ( Data ), Data[Order Number] <= EARLIER ( Data[Order Number] ) )
)
Hi @danextian The place where you are using -SUm(Data[Value])..I cannot do it because my Location Count Column is a measure and your value column is a column here.
Is there any other work around?
Hi @learner03,
After hours of research, I hope I have found the solution. Take note that is not my original. It is derived from the proposed solution of Ashish_Mathur on https://community.powerbi.com/t5/Desktop/Filtering-and-ADDCOLUMNS-field-containing-a-cumulative-sum-...
LocCount Rank =
RANKX ( ALL ( Data[Order Number] ), [Location sum],, ASC )
//Rank [Order Number] by Location count
Cumulative total =
SUMX (
TOPN (
[LocCount Rank],
CALCULATETABLE ( VALUES ( Data[Order Number] ), ALL ( Data[Order Number] ) ),
[LocCount Rank], ASC
),
[Sum of Value]
)
sample pbix - https://drive.google.com/file/d/1J_lt38GY3QhY2GJ_numIt7a37j_IBWMl/view?usp=sharing
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
81 | |
80 | |
59 | |
35 | |
35 |
User | Count |
---|---|
100 | |
60 | |
56 | |
46 | |
41 |