Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. 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 |
---|---|
76 | |
75 | |
54 | |
38 | |
31 |
User | Count |
---|---|
99 | |
56 | |
50 | |
42 | |
40 |