Forum Discussion
jak8282
Helper III
3 years agoCreate a calculated running column based on week commencing total
Hi, I have a table which I bring which looks like Datekey WC Forecast Region 20221121 20221121 61 Africa 20221122 20221121 61 Afr...
- Anonymous3 years ago
Hi jak8282 ,
You can update the formula of calculated column [Running Total] as below, please find the details in the attachment.
Running Total = VAR _rtforecast = CALCULATE ( SUM ( 'Table'[Forecast] ), FILTER ( 'Table', 'Table'[Region] = EARLIER ( 'Table'[Region] ) && 'Table'[Datekey] <= EARLIER ( 'Table'[Datekey] ) ) ) RETURN DIVIDE ( _rtforecast, 7 )Best Regards
jak8282
Helper III
3 years agoHi Rena,
Apologies would want it like
| Datekey | WC | Forecast | Region | Running Total |
| 20221101 | 20221101 | 61 | Africa | 9 |
| 20221102 | 20221101 | 61 | Africa | 17 |
| 20221103 | 20221101 | 61 | Africa | 26 |
| 20221104 | 20221101 | 61 | Africa | 35 |
| 20221105 | 20221101 | 61 | Africa | 44 |
| 20221106 | 20221101 | 61 | Africa | 52 |
| 20221107 | 20221101 | 61 | Africa | 61 |
| 20221108 | 20221108 | 20 | Africa | 64 |
| 20221109 | 20221108 | 20 | Africa | 67 |
| 20221110 | 20221108 | 20 | Africa | 70 |
| 20221111 | 20221108 | 20 | Africa | 72 |
| 20221112 | 20221108 | 20 | Africa | 75 |
| 20221113 | 20221108 | 20 | Africa | 78 |
| 20221114 | 20221108 | 20 | Africa | 81 |
Thanks
Chris
- Anonymous3 years agoNot applicable
Hi jak8282 ,
You can update the formula of calculated column [Running Total] as below, please find the details in the attachment.
Running Total = VAR _rtforecast = CALCULATE ( SUM ( 'Table'[Forecast] ), FILTER ( 'Table', 'Table'[Region] = EARLIER ( 'Table'[Region] ) && 'Table'[Datekey] <= EARLIER ( 'Table'[Datekey] ) ) ) RETURN DIVIDE ( _rtforecast, 7 )Best Regards
- jak82823 years ago
Helper III
Thanks Rena- that works great.