Forum Discussion
running sum based on dates
Hi Expert,
I wanted to add running column based on running sum as third column in power BI based on date
| Date | SalesCount |
| 20220223 | 2499 |
| 20220303 | 1 |
Hi Anonymous
You need to create a relationship between Date table and Sales table on date column (one-to-many, single direction). Then create the following measure
Cumulative Total = CALCULATE ( SUM ( 'Sales'[SalesCount] ), FILTER ( ALL ( 'Calendar Table' ), 'Calendar Table'[Date] <= MAX ( 'Calendar Table'[Date] ) ) )Here are some blogs for your reference:
Power BI: Calculating Cumulative Totals for Time Periods
Computing running totals in DAX - SQLBI
Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.
4 Replies
- amitchandakSuper User
Anonymous , a new column
sumx(filter(Table, [Date] < earlier([Date]) ), [sales Count])
a new measure =
sumx(filter(allselected(Table), Table[Date] < max(Table[Date]) ), Table[sales Count])
- AnonymousNot applicable
Hi Expert,
but the saledate is coming from Datetable and salecount from sales table how we can differentiate in calculation
- AnonymousNot applicable
Hi Expert,
but the saledate is coming from Datetable and salecount from sales table how we can differentiate in calculation
- v-jingzhangCommunity Support
Hi Anonymous
You need to create a relationship between Date table and Sales table on date column (one-to-many, single direction). Then create the following measure
Cumulative Total = CALCULATE ( SUM ( 'Sales'[SalesCount] ), FILTER ( ALL ( 'Calendar Table' ), 'Calendar Table'[Date] <= MAX ( 'Calendar Table'[Date] ) ) )Here are some blogs for your reference:
Power BI: Calculating Cumulative Totals for Time Periods
Computing running totals in DAX - SQLBI
Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.