Forum Discussion
Cumulative Total Balance per Line Under Certain Conditions
- 6 years ago
Hi Ajungx ,
We can create a measure to meet your requirement.
CumBalance = CALCULATE ( SUM ( 'Table'[Balance] ), FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Cst Name] = MAX ( 'Table'[Cst Name] ) && 'Table'[Date] <= MAX ( 'Table'[Date] ) ) )If it doesn’t meet your requirement, could you please show the exact expected result based on the table that you have shared?
Best regards,
Community Support Team _ zhenbw
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
BTW, pbix as attached.
Ajungx , Try with a date table
Cumm = CALCULATE(SUM(Table[Balance]),filter(date,date[date] <=maxx(date,date[date])))
Cumm = CALCULATE(SUM(Table[Sales Amount]),filter(date,date[date] <=max(Table[Date])))
or
Cumm = CALCULATE(SUM(Table[Balance]),filter(allselected(date),date[date] <=maxx(date,date[date])))
or
Cumm = CALCULATE(SUM(Table[Sales Amount]),filter(allselected(Table),Table[date] <=max(Table[Date])))