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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
romovaro
Responsive Resident
Responsive Resident

Accumulative Average calculation using difference in dates

Hello

 

I have a question about creating accumulative measures on Power BI 

 

I have a table with different tasks and Assigned date and Completed Date. I have a formula to get the difference (in days) between both dates:

 

_DateDiferrence =
VAR
Sum_Date=Calculate(sumx('BMPS LOF Report','BMPS LOF Report'[TASK_COMPLETED_DATE2]-'BMPS LOF Report'[TASK_ASSIGNED_ON2]))
RETURN
if(sum_Date>=0,Sum_Date,0)
 
With the diff in days, I can show the average days x step (task).
 
romovaro_0-1642582706544.png

 

 

Now I would like to create a different table showing the cumulative in days of the Total process.

Any help, pls? thanks

 

romovaro_1-1642582795647.png

 

 
 
 

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@romovaro , Assume You want sum till step level sum and avg after that

 

_DateDiferrence =
VAR
Sum_Date=AverageX( Values('BMPS LOF Report'[Step] ) , Calculate(sumx('BMPS LOF Report','BMPS LOF Report'[TASK_COMPLETED_DATE2]-'BMPS LOF Report'[TASK_ASSIGNED_ON2])))
RETURN
if(sum_Date>=0,Sum_Date,0)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @romovaro 

Has your problem been solved ? If it has been solved, then please consider Accept it as the solution to help the other members find it more quickly.

 

Best Regard

Community Support Team _ Ailsa Tao

amitchandak
Super User
Super User

@romovaro , Assume You want sum till step level sum and avg after that

 

_DateDiferrence =
VAR
Sum_Date=AverageX( Values('BMPS LOF Report'[Step] ) , Calculate(sumx('BMPS LOF Report','BMPS LOF Report'[TASK_COMPLETED_DATE2]-'BMPS LOF Report'[TASK_ASSIGNED_ON2])))
RETURN
if(sum_Date>=0,Sum_Date,0)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hello Amitchandak

 

I created the new field as you described but it shows 0 in all the steps.

I believe I am doing something wrong

 

DateDiference2 =
VAR
Sum_Date=AverageX( Values('BMPS LOF Report'[Steps] ) , Calculate(sumx('BMPS LOF Report','BMPS LOF Report'[TASK_COMPLETED_DATE2]-'BMPS LOF Report'[TASK_ASSIGNED_ON2])))
RETURN
if(sum_Date>=0,Sum_Date,0)
 
romovaro_0-1642599086536.png

 

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.