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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Luca2020
Helper I
Helper I

CUMULATE SUM in different visuals

Hi,

I'm trying to calculate the cumulative sum of IMP_COGE per month for a balance sheet.

So far I've tried the following measure: 

 

IMP_SP = CALCULATE (CALCULATE (SUM ('PRIMANOTA RIGHE'[Imp_COGE]) *-1, FILTER (ALLSELECTED ('DATA BILANCIO'), 'DATA BILANCIO'[Date]<=MAX ('DATA BILANCIO'[Date]))), FILTER ('PRIMANOTA RIGHE', 'PRIMANOTA RIGHE'[Tipo Conto] = "P (Patrimoniale)"))

 

and it gives me the correct cumulative sum if I use a Gauge Chart, however, if i use the measure in a table with the month filter, it only gives me the variation of the value per month 

 

I.E in the Gauce Chart --> + 120

in the table --> January +100                        

                          February + 20                      

                           ...

 

I've also tried 

 

IMP_SP =CALCULATE ( SUM ( 'PRIMANOTA RIGHE'[Imp_COGE] ), FILTER ( ALL ( 'DATA BILANCIO'), 'DATA BILANCIO'[Date] <= MAX ( 'DATA BILANCIO'[Date]) ))  

 

but then it simply sum all the amount per month without considering the different years and other filters like the data table stopped working.  

 

only   

 

IMP_SP = TOTALYTD(SUM('PRIMANOTA RIGHE'[Imp_COGE]), 'DATA BILANCIO'[Date].[Date])  

 

seems to work, however in a line chart I only see the current year value and other years are zero.   

What I'm trying to achieve is

 

1. a table with the months as columns and the cumulative amount for accounts as row

FILTER YEAR 2020  

 

TABLE:             

 

           MONTH 1     MONTH 2 

BANK     100 €           120 €  

 

2. and in a different report, a line chart with the cumulative sum indipendently from the year:  

 

LINE CHART:  cumulative sum but as a continous flow, with different years: 

 

BANK         30,00 €                -   40,00                €  100,00 €         120,00 €

             november 2019   dicember 2019      january 2020     february 2020 

 

Thanks, 

1 REPLY 1
AlB
Community Champion
Community Champion

Hi @Luca2020 

Can you share the pbix perhaps? It's a bit difficult to see what is going on like that. OR a pbix with dummy data that reproduces the problem. Or at least show samples of the tables in your model involved in the calculations and their relationships

Please mark the question solved when done and consider giving a thumbs up if posts are helpful.

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

Cheers 

 

SU18_powerbi_badge

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.