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.
I found a solution to my problem but I don't know why the cumulative sum is not working.
I have the following table which brings me some data which I want to add cumulatively, the question is that when filtering is not applying the cumulative sum function.
following the above logic, the table with the filter enabled should look like this
The function I found and am using is the following
Cumulative_Revenue = CALCULATE(SUM('Hoja1 (2)'[Value]), FILTER(ALLSELECTED('Hoja1 (2)'[# Month]), YEAR('Hoja1 (2)'[# Month])=YEAR(MAX('Hoja1 (2)'[# Month]))&&'Hoja1 (2)'[# Month] <= MAX('Hoja1 (2)'[# Month])))
I would appreciate if you can help me to find the error why it is not adding correctly cumulatively with the filter activated.
Solved! Go to Solution.
Hi, @46Days
You can try the following methods.
Measure =
VAR _Cumulative1 = CALCULATE ( SUM ( 'Table'[Value] ),
FILTER ( ALL ( 'Table' ),
[# Month] <= SELECTEDVALUE ( 'Table'[# Month] )
&& [Service] = SELECTEDVALUE ( 'Table'[Service] ) ) )
VAR _Cumulative2 = CALCULATE ( SUM ( 'Table'[Value] ),
FILTER ( ALL ( 'Table' ),
[# Month] = SELECTEDVALUE ( 'Table'[# Month] )
&& [Service] <= SELECTEDVALUE ( 'Table'[Service] ) ) )
RETURN
IF ( ISFILTERED ( 'Table'[Month] ), _Cumulative2, _Cumulative1 )
Is this the result you expect?
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @46Days
You can try the following methods.
Measure =
VAR _Cumulative1 = CALCULATE ( SUM ( 'Table'[Value] ),
FILTER ( ALL ( 'Table' ),
[# Month] <= SELECTEDVALUE ( 'Table'[# Month] )
&& [Service] = SELECTEDVALUE ( 'Table'[Service] ) ) )
VAR _Cumulative2 = CALCULATE ( SUM ( 'Table'[Value] ),
FILTER ( ALL ( 'Table' ),
[# Month] = SELECTEDVALUE ( 'Table'[# Month] )
&& [Service] <= SELECTEDVALUE ( 'Table'[Service] ) ) )
RETURN
IF ( ISFILTERED ( 'Table'[Month] ), _Cumulative2, _Cumulative1 )
Is this the result you expect?
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
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 |
---|---|
79 | |
78 | |
59 | |
36 | |
33 |
User | Count |
---|---|
94 | |
61 | |
56 | |
49 | |
41 |