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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Luca2020
Helper I
Helper I

Cumulative Sum per month

Hi, 

i'm trying to make the balance sheet of my group using power bi.

 

I'm using a dataset that includes 4 different companies and different years. This dataset is related to a data table, to a table which contains our companies name and the Chart of Accounts. 

Immagine.png

  • By using the year form the data table, the Account type form the Chart of Account, and the Company table as filters, I was able to create a Visualization which gives me for a certain year (i.e 2020), and for a certain company (i.e "A"), the Balance sheet ("Patrimoniale") and the income statement ("Economico") divided by month, according to the selected Account type. 

ScreenHunter 483.png

 

My problem is that while the result of the income statement for a certain month is the sum of the amount from the first day of the selected month to the last day of the selected month, for the balance sheet is from the first day of the year to the end of the selected month. 

 

I've tried all solution posted in this forum for cumulative sum but the value are still incorrect. I believe the reason is that i have amount form different years and the calculated column gives me the cumulative sum also from those years despite the year filter in the visualization. 

 

I'd prefere to find a solution that only force me to split the Balance Type in two visualizations (one visualization for the balance sheet where I use a calculated column or a measure for the cumulative sum by month, one visualization for the income statement which is correct as it is now). I'd prefer mantain the multiple years and companies so that i can switch between them just with a filter. 

 

Thanks in advance!

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Check this pattern (it's what I get when searching for 'balance sheet'): https://www.daxpatterns.com/cumulative-total/

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Check this pattern (it's what I get when searching for 'balance sheet'): https://www.daxpatterns.com/cumulative-total/

Hi,
thanks, it worked. In my case the measure was
 
IMP_SP = CALCULATE(SUM('PRIMANOTA '[Amount])*-1, FILTER( ALLSELECTED('DATA'), 'DATA '[Date]<=MAX('DATA '[Date])), FILTER('ACCOUNTS', 'ACCOUNTS'[Type]="P (Patrimoniale)"))

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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