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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
TJacobs
Frequent Visitor

PowerBi cumulative calculation goes wrong

Hi all,

 

I'm in a loss in this matter, I've tried many DAX formulas and read many forums but unfortunately I didn't found the solution. 


This is the issue 
I've created a calculated Line Chart but it's showing the wrong cumulative turnover. Currently I'm using the formula that I found on this forum: 

Cumulative 2 = 
CALCULATE (
    SUM ( 'Invoice lines'[Sales] ),
    FILTER (
        ALLSELECTED(BI-Dates),
        'BI-Dates'[Date] <= MAX ( 'BI-Dates'[Date] )
    )
)

But the issue is that it's not showing data when there is no turnover is the current month.

 

So let's say that I have two product groups - Cars and Motors. When I select them both and also select month 1 till 9 it says that I have a turnover of 9000 in month 8. But when I select month 1 till 8 it says that I have a turnover of 8000 in month 8 - that's because I didn't sold a Car in month.

 

Because of the fact there isn't sold anything PowerBI doens't registers a 0 but just nothing... if he would registers a 0 the problem was probably solved....

 

Does someone know how I could solve this issue?

1 ACCEPTED SOLUTION

Hi @TJacobs,

 

Based on my test, the formula below should work in your scenario. Smiley Happy

Sales Cumulative = 
CALCULATE (
    SUM ( 'Blad1 (2)'[Turnover total]),
    FILTER (
        ALLSELECTED('Blad1 (2)'),
        'Blad1 (2)'[Date_Month] <= MAX('Blad1 (2)'[Date_Month]) 
    )
)

r3.PNG

 

Regards

View solution in original post

5 REPLIES 5
TJacobs
Frequent Visitor

Hello,

 

Thanks for you replies! 

Here is the link to the example PBIX and Excel file:

https://siennonline-my.sharepoint.com/personal/teun_jacobs_sienn_com1/_layouts/15/guestaccess.aspx?f...

 

To reproduce the issue: please select all the product groups except subgroup ''Damage'' and move the cursor to the second month in the line chart. The line chart now says that there is a turnover of ''5000''. Now when you deselect the third month it says that you have a turnover of ''3500'' but it should be ''5000'' like the green card is displaying. 

Hi @TJacobs,

 

Based on my test, the formula below should work in your scenario. Smiley Happy

Sales Cumulative = 
CALCULATE (
    SUM ( 'Blad1 (2)'[Turnover total]),
    FILTER (
        ALLSELECTED('Blad1 (2)'),
        'Blad1 (2)'[Date_Month] <= MAX('Blad1 (2)'[Date_Month]) 
    )
)

r3.PNG

 

Regards

Yep! now it's working! 

Thanks! 🙂

v-ljerr-msft
Microsoft Employee
Microsoft Employee

Hi @TJacobs,

 

Based on my test, the formula provided above should work in your scenario. Could you share a sample pbix file which can reproduce the issue, so that we can help further investigate on it? You can upload it to OneDrive or Dropbox and post the link here. Do mask sensitive data before uploading. Smiley Happy

 

Regards

Greg_Deckler
Community Champion
Community Champion

Can you post some sample data?

 

https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.

Top Solution Authors