Showing results for 
Search instead for 
Did you mean: 
Regular Visitor

Get average of DATEDIFF



I'm trying to create a report that shows the average number of days it takes from opening a position, to a new employee starting at the firm.


The startDate is in a different table than the Creation date. I have created a measure:


DaysOpen = 

    DATEDIFF ( MIN ( 'TableA'[CreationDate] );

                       MIN ( 'TableB'[StartDate] );

                               DAY )


When I use the measure for each position (record), this works fine. However, when I try to aggregate this, say I want the average per Department, I get stuck.


I don't think I could use AVERAGEX, since the DATEDIFF is calculated over different tables. 


Any thoughts on how I should handle this?


Kind Regards,




Super User IX
Super User IX

Re: Get average of DATEDIFF

@PowerBI_M , refer my blog on this , you need a common context for that

Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!


Re: Get average of DATEDIFF

Hi @PowerBI_M ,


Just use summarize table as first parameter for AVERAGEX, Would you please inform us more detailed information( your  data(by OneDrive for Business)) if possible? Then we will help you more correctly.


Best Regards,

Dedmon Dai

Helpful resources

Community Conference

Power Platform Community Conference

Find your favorite faces from the community presenting at the Power Platform Community Conference!

Upcoming Events

Experience what’s next for Power BI

See the latest Power BI innovations, updates, and demos from the Microsoft Business Applications Launch Event.


Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

Mark your calendars and join us for our next Power BI Dev Camp!.

Top Solution Authors