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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.