Forum Discussion
running total with filter date
Can any one help with dax for filter date and car number should get running total of the person from stating
example table
| Name | Car | Amount | Type of debit | Date | Net | Debit | Credit | Balance |
| XYZ | XX car | 1000 | Amount debit | 21-03-2024 00:05 | 1000 | 1000 | 0 | 1,000.00 |
| XYZ | XX car | 1000 | Amount debit | 21-03-2024 00:05 | 1000 | 1000 | 0 | 2,000.00 |
| XYZ | XX car | 160 | Amount debit | 21-03-2024 00:05 | 160 | 160 | 0 | 2,160.00 |
| XYZ | XX car | 172.36 | Amount debit | 21-03-2024 00:05 | 172.36 | 172.36 | 0 | 2,332.36 |
| XYZ | XX car | 125 | Amount debit | 21-03-2024 00:05 | 125 | 125 | 0 | 2,457.36 |
| XYZ | XX car | 12.76 | Amount debit | 21-03-2024 00:05 | 12.76 | 12.76 | 0 | 2,470.12 |
| XYZ | XX car | 1608.74 | OnlinePayment | 21-03-2024 00:05 | -1608.7 | 0 | 1608.74 | 861.38 |
Hi, Anonymous
try below code for measure
running total = CALCULATE(SUM('Table (4)'[Balance]), FILTER( ALLSELECTED('Table (4)'), 'Table (4)'[Date]<=MAX('Table (4)'[Date])))All date are same that the reason total balance are same in all row
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
3 Replies
- Dangar332
Resident Rockstar
Hi, Anonymous
try below code for new columnColumn = SUMX( FILTER( ALL('Table (2)'), 'Table (2)'[Name]=EARLIER('Table (2)'[Name]) && 'Table (2)'[Car ]=EARLIER('Table (2)'[Car ]) && 'Table (2)'[Date]<=EARLIER('Table (2)'[Date]) ), 'Table (2)'[Balance] )just adjust table name and column name
- vivek31
Resolver II
Hi, Anonymous
try below code for measure
running total = CALCULATE(SUM('Table (4)'[Balance]), FILTER( ALLSELECTED('Table (4)'), 'Table (4)'[Date]<=MAX('Table (4)'[Date])))All date are same that the reason total balance are same in all row
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.- AnonymousNot applicable
Hi Thank you for reply,
actually there is not balance colume i required a balance colume as a running total so that if it filter a car number automatically it should the balnce from start date to end date as shown in the example but your query will show the same for all the days