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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Cumulative sum column for the table

Hello 

I have a table containing, Date, category1 (Fund), category 2(Board), category 3(IEO), net balance 
I need a cumulative sum of the net balance for all 3 categories with a month filter in it :

BS097_1-1660150271872.png

 

I have used DAX for the cumulative sum for the month which is working using :
Cumm actual =

Var Maxd = MAX(new_shptransactionscurrentyears[new_postingdate])
Return
   CALCULATE(SUM(new_shptransactionscurrentyears[new_netbalance]),ALLSELECTED(new_shptransactionscurrentyears) ,(new_shptransactionscurrentyears[new_postingdate] <= Maxd))

& Tried 

CALCULATE(SUM(new_shptransactionscurrentyears[new_netbalance]),filter(allselected(new_shptransactionscurrentyears[new_postingdate]),new_shptransactionscurrentyears[new_postingdate] <=max(new_shptransactionscurrentyears[new_postingdate])))


This worked fine for the month table however doesn't work on the table with categories in it or with filter on 

Thank you & I really appreciate your help 
#Need Help


1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,
Pls refer below image. I thought you need sum of current month+ previuos month for each of three category. I have highlighted one for your reference. 

DikshantKoli_0-1660833580160.png

If this is still incorrect, I guess I am still not clear on your requirement.

View solution in original post

10 REPLIES 10
Anonymous
Not applicable

Hi @Anonymous ,


Cummulative 2 =

VAR PriorMonth = CALCULATE(SUM(Sheet2[Final_1]),DATEADD(DateTable[Date],-1,MONTH))
VAR CumlTotal = SUM(Sheet2[Final_1])+ PriorMonth
return
CumlTotal

I tried with above DAX not sure if it will work but if it does pls do let me know.

Note:
I have created a separate date table and instead of Sheet2[Final_1] use the column you need. It is just for reference.
Anonymous
Not applicable

Hello @Anonymous 

Thank you for the DAX, It works absolutely fine for the cumulative sum per month 
I require cumulative sum per month & per category (Cumulative sum should happen by keeping category as well)

Hope I'm clear with explanation 

Thank you 

Anonymous
Not applicable

Hi @Anonymous ,
Pls refer below image. I thought you need sum of current month+ previuos month for each of three category. I have highlighted one for your reference. 

DikshantKoli_0-1660833580160.png

If this is still incorrect, I guess I am still not clear on your requirement.

lbendlin
Super User
Super User

Please provide sanitized sample data that fully covers your issue. I cannot help you without meaningful sample data.
Please paste the data into a table in your post or use one of the file services like OneDrive or Google Drive. I cannot use screenshots of your source data.
Please show the expected outcome based on the sample data you provided. Screenshots of the expected outcome are ok.

https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-...
https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

Anonymous
Not applicable

Hello @lbendlin 

Please find the sample dataset
https://docs.google.com/spreadsheets/d/1YSsTZym_-QGu_yC_qclEeQPcBsYmEtSh/edit?usp=sharing&ouid=11617...

Looking forward to discussing with you further 



I don't understand the logic behind the expected value. Please explain the first couple of rows.

 

lbendlin_0-1660322401218.png

 

Anonymous
Not applicable

Hello @lbendlin 

I apologize for not being descriptive with the question, Allow me to explain the problem.
I have a table called sheet 1 containing Fund, Board & IEO, Balance & pdate
I want a calculated column to take out the cumulative sum via pDate group by 3 columns(Fund, Board, Ieo)



For example 

FundIEOBoardPost DatebalanceCumulative bal
Restricted incomerent/charges 1/03/20222020
Restricted incomeSupport charges5/03/20223030
Restricted expenditure Staff cost  1/03/202255
Restricted incomerent/charges 20/03/20221030
Unrestricted incomerent/charges 5/03/2022-2020
Unrestricted incomerent/charges 1/04/20225030


The column would be much better as apply filter still works fine with different month filters rather than measure 

The solution is much appreciated & most awaited (Brain storming since days)
Thank you  🙂 



Unless you are able to show me step by step how you arrived at the expected outcome values I won't be able to assist. I haven't understood the logic yet.

Anonymous
Not applicable

Hello @lbendlin

Any luck ?
 

Anonymous
Not applicable

Hello @lbendlin 

I need a Cumulative sum of balance considering 3 categories as a group

FundIEOBoardBal

The balance should be grouped by the three above categories & make a cumulative balance by the date column

For instance : 

FundIEOBoardBalance
Restrictedincomerent20

The cumulative sum should calculate the sum of the balance when the same combination occurs in the future/down the line(calculated via dates)

FundIEOBoardBalCumm BalanceDate
Restrictedincomerent20201/08/2022
Restrictedincomerent103010/08/2022

For different combinations, it should store the same value until the next same combination is occurred which later be added to the previously occurred sum

Sorry if I couldn't be able to explain it better, I Can even contact you through other sources if this hasn't helped you understand the issue

better demonstrated on the Matrix table (looking forward to the below dashboard)
Clearly, the cumulative value is not working when the filter is selected 

BS097_0-1660332637849.png

 I need the sum of values for the previous month + the current month  in the cumulative section 

For instance: when April is selected: I need a sum of the previous month march +current month April
select march = sum(feb+march)

Imaginative purpose dashboard 

 



Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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