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 :

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

------------------------------

Bhavana Suresh

Data analyst

------------------------------

Original Message:

Sent: Sep 22, 2020 03:50 AM

From: Farhan Ahmed

Subject: Cumulative Total by Group

Then use EARLIER instead of MAX in your code`RunningTotal = CALCULATE( SUM('Input Table'[Value]), FILTER( ALLEXCEPT('Input Table', 'Input Table'[Project]), 'Input Table'[Period]<=EARLIER('Input Table'[Period]) ) )`

------------------------------

Farhan Ahmed

Senior Business Intelligence Consultant

karachi

3452523688

Original Message:

Sent: Sep 22, 2020 03:33 AM

From: Saulius G

Subject: Cumulative Total by Group

Hi Farhan,

Thanks for the quick reply. I need this to be at individual row level, as I will then do additional operations with the cumulative total. See the full sample table. I need to evaluate whether Project-Period combination will have enough inventory, considering that it is drawing from total inventory at a Project level.

Thanks,

------------------------------

Saulius G

Original Message:

Sent: Sep 22, 2020 03:17 AM

From: Farhan Ahmed

Subject: Cumulative Total by Group

Try to create Measure instead of Column

------------------------------

Farhan Ahmed

Senior Business Intelligence Consultant

karachi

3452523688

Original Message:

Sent: Sep 22, 2020 03:10 AM

From: Saulius G

Subject: Cumulative Total by Group

Hi,

I am adding a new column using DAX to calculate a running total for each group. Could somebody help me understand why my formula doesn't work as intended?

I have copied the formula and the data table from this discussion:

`RunningTotal = CALCULATE( SUM('Input Table'[Value]), FILTER( ALLEXCEPT('Input Table', 'Input Table'[Project]), 'Input Table'[Period]<=MAX('Input Table'[Period])))`

Thank you,

------------------------------

Saulius G

------------------------------