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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
jhoyabel19
Helper I
Helper I

How to Compute the Network days in PBI as new calculated column

Hi!  PBI Newbie here, 

 

How do I compute the status duration ( date diff of the two) in Workingdays? I have the following data, some status end date has blanks and for those blanks i want to automatically make it as the Dec 31, 2022 so it will still compute the date difference in Working days.


Thank you for the help.

Anonymised IdStatusVacancy CategoryVacancy TypeStatus Start DateStatus End DateStatus Duration (Working Days)
418506Offer ApprovedFieldHiring07/06/202207/06/2022 
418506Offer Awaiting Applicant DecisionFieldHiring07/06/202207/06/2022 
418506Offer AcceptedFieldHiring07/06/202212/06/2022 
418506Offer Accepted (On Boarding Forms In Progress )FieldHiring07/06/202221/06/2022 
418506Offer Accepted ( Form Completed )FieldHiring07/06/202208/06/2022 
418506Preparing Candidate OfferFieldHiring03/06/202203/06/2022 
418506Offer AuthorisingFieldHiring03/06/202207/06/2022 
398567Offer Accepted (On Boarding Forms In Progress )FieldHiring25/05/202225/05/2022 
398567Offer Accepted ( Form Completed )FieldHiring25/05/202226/05/2022 
398567Offer AuthorisingFieldHiring23/05/202223/05/2022 
398567Offer ApprovedFieldHiring23/05/202224/05/2022 
398567Offer Awaiting Applicant DecisionFieldHiring24/05/202225/05/2022 
439372Offer ApprovedFieldHiring20/09/2022  
394144Offer Authorisation FailedFieldHiring20/10/2022  
330051Offer Accepted ( Form Completed )FieldHiring30/01/2022  
492914Offer Accepted (On Boarding Forms In Progress )FieldHiring05/09/2022  
402877Offer Accepted ( Form Completed )FieldHiring25/04/2022  
560483Offer Awaiting Applicant DecisionCorporateHiring03/01/2023  
545015Offer DeclinedGSCHiring18/11/2022  
463509Offer Accepted ( Form Completed )GSCHiring27/07/2022  

 

Want outcome is like this in PBI

jhoyabel19_0-1673881423376.png

 

3 ACCEPTED SOLUTIONS
DataInsights
Super User
Super User

@jhoyabel19,

 

Try this calculated column:

 

Status Duration (Working Days) = 
VAR vStartDate = Table1[Status Start Date]
VAR vEndDate =
    COALESCE ( Table1[Status End Date], DATE ( 2022, 12, 31 ) )
VAR vResult =
    NETWORKDAYS ( vStartDate, vEndDate ) - 1
RETURN
    vResult

 

DataInsights_1-1673885585964.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

Thank you so much. It worked!!

View solution in original post

@jhoyabel19,

 

You can use the TODAY function:

 

Status Duration (Working Days) =
VAR vStartDate = Table1[Status Start Date]
VAR vEndDate =
    COALESCE ( Table1[Status End Date], TODAY () )
VAR vResult =
    NETWORKDAYS ( vStartDate, vEndDate ) - 1
RETURN
    vResult




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

4 REPLIES 4
DataInsights
Super User
Super User

@jhoyabel19,

 

Try this calculated column:

 

Status Duration (Working Days) = 
VAR vStartDate = Table1[Status Start Date]
VAR vEndDate =
    COALESCE ( Table1[Status End Date], DATE ( 2022, 12, 31 ) )
VAR vResult =
    NETWORKDAYS ( vStartDate, vEndDate ) - 1
RETURN
    vResult

 

DataInsights_1-1673885585964.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




@DataInsights , 

May I ask for the blank dates is there a chance if there's a way instead of using fixed Dec 31, 2022 > we can use the Today's date so PBI can automatically compute it? Is it possible?

@jhoyabel19,

 

You can use the TODAY function:

 

Status Duration (Working Days) =
VAR vStartDate = Table1[Status Start Date]
VAR vEndDate =
    COALESCE ( Table1[Status End Date], TODAY () )
VAR vResult =
    NETWORKDAYS ( vStartDate, vEndDate ) - 1
RETURN
    vResult




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Thank you so much. It worked!!

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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