Forum Discussion
fazza1991
Helper II
4 years agoCalculated Column Cumulative /Running total by customer
Hi,
I am trying to do a calculated "COLUMN" to get a running total by customer and date from FIRST INVOICE DATE to the CURRENT INVOICE DATE.
| Date | Account_Id | Account_Name | Net_Revenue | FirstInvoice | LastInvoice |
| 31/10/2013 | INSTAR | INSTAR | 2000 | 31/10/2013 | 31/12/2013 |
| 30/11/2013 | INSTAR | ISNTAR | 2000 | 31/10/2013 | 31/12/2013 |
| 31/12/2013 | INSTAR | INSTAR | 2000 | 31/10/2013 | 31/12/2013 |
| 31/10/2013 | FINSTAR | FINSTAR | 1000 | 31/10/2013 | 30/11/2013 |
| 30/11/2013 | FINSTAR | FINSTAR | 2000 | 31/10/2013 | 30/11/2013 |
I would expect the following results but i just cant seem to get it right
| Date | Account_Id | Account_Name | Revenue | FirstInvoice | LastInvoice | Running_Total |
| 31/10/2013 | INSTAR | INSTAR | 2000 | 31/10/2013 | 31/12/2013 | 2000 |
| 30/11/2013 | INSTAR | INSTAR | 2000 | 31/10/2013 | 31/12/2013 | 4000 |
| 31/12/2013 | INSTAR | INSTAR | 2000 | 31/10/2013 | 31/12/2013 | 6000 |
| 31/10/2013 | FINSTAR | FINSTAR | 1000 | 31/10/2013 | 30/11/2013 | 1000 |
| 30/11/2013 | FINSTAR | FINSTAR | 2000 | 31/10/2013 | 30/11/2013 | 3000 |
Any help at this point would be great
Note I am specifically looking for calculated COLUMN.
Thanks
a new column
= sumx(filter(Table, [Account_Id] = earlier([Account_Id]) && [Date] <= earlier([Date]) ) , [Net_Revenue] )
2 Replies
- amitchandak
Super User
a new column
= sumx(filter(Table, [Account_Id] = earlier([Account_Id]) && [Date] <= earlier([Date]) ) , [Net_Revenue] )
- fazza1991
Helper II
Genius!!! Thanks a mil!