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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Analitika
Post Prodigy
Post Prodigy

Wrong cumulative sum in Power BI

Hi, 

 

I can't calculate properly cumulative sum in Power BI. I am getting different numbers as not expexted:

 

CF vaizdavimas Investicine kaupimas = 
IF (
    CONTAINS ( 'Pasirinkti_CF', 'Pasirinkti_CF'[Parinkimas], "Investicinė veikla (sukaupta)" ),
CALCULATE ([Pinigu srautas], FILTER ( ALLSELECTED ( 'Date'), 'Date'[Date] <= MAX ( 'Date'[Date] ) ), FILTER('N01_KODAS_SS','N01_KODAS_SS'[Sask_kod_info.Pinigu srautui_2]="Pinigų srautas iš investicinės veiklos")),
    BLANK ()
)

 

Here is a cumulative function.

it sums not correctly somehow.

Total should be 

Analitika_0-1661329628113.png

 

but it is in visual: -135,378

 

 

7 REPLIES 7
Fowmy
Super User
Super User

@Analitika 

Please apply the following DAX measure and try

CF vaizdavimas Investicine kaupimas =
VAR __Date =
    MAX ( 'Date'[Date] )
RETURN
    IF (
        CONTAINS (
            'Pasirinkti_CF',
            'Pasirinkti_CF'[Parinkimas], "Investicinė veikla (sukaupta)"
        ),
        CALCULATE (
            [Pinigu srautas],
            'Date'[Date] <= __Date,
            'N01_KODAS_SS'[Sask_kod_info.Pinigu srautui_2] = "Pinigų srautas iš investicinės veiklos",
            ALLSELECTED ( 'Date' )
        )
    )
Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Analitika_0-1661333341326.png

Marked value in table is correct but in visual shows nonsense:

Analitika_1-1661333403761.png

 

@Analitika 

Wihout being able to see your model, the calculations and how you have applied filters, it's hard to suggest a solution. Please share an example file that show the issue you are facing.

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Hi,

 

Analitika_1-1661337097202.png

Here cumulative sum will 832400. 

 

But when I see in visual I see -867, 600

Analitika_0-1661336204536.png

 

PaulDBrown
Community Champion
Community Champion

Please share sample non-confidential data or PBIX file





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






I don't have it.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.

Users online (3,623)