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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Super User
Super User

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors