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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
Syndicate_Admin
Administrator
Administrator

Average between dates

Hello!

I am calculating the average between 2 dates (application start date and closing date). Create a column to calculate the duration with the following formula: Duration = DATEDIFF('Table'[Start Date],'Table'[Dated],DAY)

LuisaF1126_0-1631115023999.pngLuisaF1126_1-1631115052650.pngLuisaF1126_2-1631115072697.png

The problem is that there are cases that are still open and do not have a closing date, therefore they are blank. But when calculating the averages with the function Average Attention Span (Days) = AVERAGE('Table'[Duration])

It is resulting in a value much higher than the real average.
LuisaF1126_3-1631115111458.pngEI calculated the value manually and it gives me 14.83.

How can I solve this?

Thanks for the help.

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

Assuming Duration is a calculated column formula, edit the formula to:

Duration = if(isblank(Table[dated]),blank(),DATEDIFF('Table'[Start Date],'Table'[Dated],DAY))

The average should not be correct.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

2 REPLIES 2
Ashish_Mathur
Super User
Super User

Hi,

Assuming Duration is a calculated column formula, edit the formula to:

Duration = if(isblank(Table[dated]),blank(),DATEDIFF('Table'[Start Date],'Table'[Dated],DAY))

The average should not be correct.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
lbendlin
Super User
Super User

You can solve this by defining what should happen in such a case - should the data be excluded, or should the missing Close Date be substituted with "today"?

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.