Forum Discussion
Running total to date
- 6 years ago
If the date increases daily, you could create calculated columns below:
earlier = CALCULATE ( SUM ( 'Table'[Running Value] ), FILTER ( 'Table', 'Table'[Country] = EARLIER ( 'Table'[Country] ) && 'Table'[Date] = EARLIER ( 'Table'[Date] ) - 1 ) ) daily total = [Running Value]-[earlier]As tested, if i understand you correctly, your second visual has some wrong data due to teh calculation rule.
Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. - 6 years ago
Thank you so much, it work out to perfection.
- 6 years ago
- 6 years ago
This solution was created using Power Query as you have posted your question in PQ section, the script dose Include the M code in Added Column step of the script.
Best Regards,
Mariusz
If this post helps, then please consider Accepting it as the solution.
Please feel free to connect with me.
LinkedIn
I do not understand. Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
Hi Greg,
I tried all could, but stiil nothing worked, my request is very straight forward, i need to breakdown the incremental value on date wise in Daily Total Column. Appreciated your help
| Country | Date | Incremental Total | Daily total |
| Afghanistan | 1/20/2020 | 5 | 5 |
| Albania | 1/20/2020 | 10 | 10 |
| Algeria | 1/20/2020 | 2 | 2 |
| Afghanistan | 1/21/2020 | 10 | 5 |
| Albania | 1/21/2020 | 20 | 10 |
| Algeria | 1/21/2020 | 2 | 0 |
| Afghanistan | 1/22/2020 | 12 | 2 |
| Albania | 1/22/2020 | 40 | 30 |
| Algeria | 1/22/2020 | 4 | 4 |
| Afghanistan | 1/23/2020 | 15 | 3 |
| Albania | 1/23/2020 | 42 | 12 |
| Algeria | 1/23/2020 | 17 | 13 |
| Afghanistan | 1/24/2020 | 22 | 7 |
| Albania | 1/24/2020 | 42 | 30 |
| Algeria | 1/24/2020 | 23 | 10 |
| Afghanistan | 1/25/2020 | 50 | 28 |
| Albania | 1/25/2020 | 43 | 13 |
| Algeria | 1/25/2020 | 26 | 16 |
- v-juanli-msft6 years agoCommunity Support
If the date increases daily, you could create calculated columns below:
earlier = CALCULATE ( SUM ( 'Table'[Running Value] ), FILTER ( 'Table', 'Table'[Country] = EARLIER ( 'Table'[Country] ) && 'Table'[Date] = EARLIER ( 'Table'[Date] ) - 1 ) ) daily total = [Running Value]-[earlier]As tested, if i understand you correctly, your second visual has some wrong data due to teh calculation rule.
Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.- AjithTravvise6 years agoHelper II
Thank you so much, it work out to perfection.
- AjithTravvise6 years agoHelper II
Hi Juanli,
Thanks for your earliet help, but when i added one more column which is province, the daily total shows negative value. It would be appreciated if you could help.
- v-juanli-msft6 years agoCommunity Support
Does the [incremental total] sum values in country level or in province level?
is the column ok?
earlier = CALCULATE ( SUM ( 'Table'[Running Value] ), FILTER ( 'Table', 'Table'[Country] = EARLIER ( 'Table'[Country] ) &&'Table'[Province]=EARLIER('Table'[Country]) && 'Table'[Date] = EARLIER ( 'Table'[Date] ) - 1 ) )If not, please share a simple sample for me to test.
Best Regards
Maggie