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
CristianConto
Regular Visitor

Average NetworkDays

Hello all.

I've been trying to create this function for last two days... I'm getting crazy....

 

O tried a lot of different ways using DAX but nothing is working as expected here..

I need to calculate the average networkdays (including holidays). So, here is an example of my table, and I have a join to a CalendarTable by OrderDate. This table has multiple orders, each order has a status assigned. I need to create this average for the first date with Status 1 or 2 and the first date of Status 4.
I may have all status in the same day (in this case the Delta would be 0) or and I can have the Status 1 in one week and two weeks later the status 4, in this case, i need to calculate the network days (Excluding Saturday, Sunday and Holidays if it has).

 

Any Idea about how to make it work?

Regards.

 

OrderNumberOrderDateStatus
11/9/2018Status 1
11/9/2018Status 2
11/11/2018Status 3
11/14/2018Status 4
21/20/2018Status 1
21/21/2018Status 2
21/22/2018Status 3
21/23/2018Status 4
21/24/2018Status 6
21/25/2018Status 7
21/26/2018Status 8
31/18/2018Status 2
31/19/2018Status 3
31/20/2018Status 3

 

image.png

 

1 ACCEPTED SOLUTION
v-chuncz-msft
Community Support
Community Support

@CristianConto,

 

You may try to select Pivot Column in Query Editor, then use AVERAGEX Function in DAX.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-chuncz-msft
Community Support
Community Support

@CristianConto,

 

You may try to select Pivot Column in Query Editor, then use AVERAGEX Function in DAX.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.