Forum Discussion
Bokchoy
Helper II
4 years agoCustom Sum based on matching column values
Hi All, I have a single table where all sales records are kept. there are 2 types of sales records in this table. Primary sales record have a [Main] attribute of "M", and sub-records have a ...
- 4 years ago
Hi Bokchoy
Use this to create a new column
Col Cost = CALCULATE(SUM([Cost]), FILTER('Table', 'Table'[Date] = EARLIER('Table'[Date]) && 'Table'[user_id] = EARLIER('Table'[user_id]) && 'Table'[Type] = EARLIER('Table'[Type])))Regards
Phil
PhilipTreacy
Super User
4 years agoHi Bokchoy
Use this to create a new column
Col Cost = CALCULATE(SUM([Cost]), FILTER('Table', 'Table'[Date] = EARLIER('Table'[Date]) && 'Table'[user_id] = EARLIER('Table'[user_id]) && 'Table'[Type] = EARLIER('Table'[Type])))
Regards
Phil
Bokchoy
Helper II
4 years agoThank you sir, works perfectly 🙂