Forum Discussion
guilledo24
8 years agoRegular Visitor
New column with total by id
Hi, I have the next table ID | SALES 1 | 123 2 | 50 1 | 08 3 | 26 3 | 74 2 | 12 1 | 59 And i need to create a new column to have the total sales b...
- 8 years ago
Hi guilledo24
I think this calculated column gets pretty close
Total = CALCULATE( SUM('Table1'[Sales]), FILTER( 'Table1', 'Table1'[ID]= EARLIER(Table1[ID]) ) )
Phil_Seamark
Microsoft Employee
8 years agoHi guilledo24
I think this calculated column gets pretty close
Total =
CALCULATE(
SUM('Table1'[Sales]),
FILTER(
'Table1',
'Table1'[ID]= EARLIER(Table1[ID])
)
)guilledo24
8 years agoRegular Visitor
Phil_Seamark thanks for answering, that solution it's excelent.
Now I need the same result but the total sales by id, month and year, can you give me the best solution?
id | SALES | MONTH | YEAR
1 | 120 | 2 | 2018
2 | 500 | 6 | 2017
1 | 100 | 3 | 2018
3 | 260 | 3 | 2017
3 | 740 | 2 | 2018
2 | 120 | 2 | 2017
1 | 590 | 6 | 2017
3 | 590 | 2 | 2018