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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
PowerBI_M
Regular Visitor

Get average of DATEDIFF

Hi,

 

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,

 

M.

 

2 REPLIES 2
v-deddai1-msft
Community Support
Community Support

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

amitchandak
Super User
Super User

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.