Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

View all the Fabric Data Days sessions on demand. View schedule

Reply
OLADAODU
Frequent Visitor

Please I need help. DAX to help calculate the daily data from the running cumulative dated

DateRunning Total Daily Total

09/03/2020        0 
10/03/2020        1 
11/03/2020        1 
12/03/2020        1 
13/03/2020        1 
14/03/2020        1 
15/03/2020        2 
16/03/2020        4 
17/03/2020        6 
18/03/2020       32 
19/03/2020       49 
20/03/2020       68 
21/03/2020       81 
22/03/2020       84 
23/03/2020       85 
24/03/2020      128 
25/03/2020      163 
26/03/2020      181 
27/03/2020      219 
28/03/2020      261 
29/03/2020      289 
30/03/2020      313 
31/03/2020      344 
01/04/2020      380 
02/04/2020      437 
03/04/2020      497 
04/04/2020      515 
05/04/2020      558 
06/04/2020      620 
07/04/2020      689 
08/04/2020                        763 
09/04/2020                        813 
10/04/2020                        853 
1 ACCEPTED SOLUTION
az38
Community Champion
Community Champion

Hi @OLADAODU 

use a column

Daily = 
var _prevDate = CALCULATE(MAX('Table'[Date]),FILTER(ALL('Table'),'Table'[Date]<EARLIER('Table'[Date])) )
RETURN
[Running Total]-CALCULATE(MAX('Table'[Running Total]),FILTER(ALL('Table'),'Table'[Date]=_prevDate))

do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

View solution in original post

4 REPLIES 4
az38
Community Champion
Community Champion

Hi @OLADAODU 

use a column

Daily = 
var _prevDate = CALCULATE(MAX('Table'[Date]),FILTER(ALL('Table'),'Table'[Date]<EARLIER('Table'[Date])) )
RETURN
[Running Total]-CALCULATE(MAX('Table'[Running Total]),FILTER(ALL('Table'),'Table'[Date]=_prevDate))

do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn
OLADAODU
Frequent Visitor

@az38 

thanks once again for the solution. Please can you give brief explanation. Few DAX i tried was returning the running cummulative. But using the variables seems to work rather the actually scripts i wrote. more light pls. Many thanks

az38
Community Champion
Community Champion

Hi @OLADAODU 

variables make the statement more readable, easier to debug and (the first, actually) more performance effective if you use some value multiple times

In this case I used a variable for two first reasons


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn
OLADAODU
Frequent Visitor

Thanks @az38 

 

The solution returns the values i was expecting. Thanks alot 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors