Forum Discussion

Elisa112's avatar
Elisa112
Helper V
1 year ago
Solved

Networkdays function with blank start dates

Hi Experts 

 

I am using the network days function :

 

Meeting date diff= NETWORKDAYS('Meetings'[1st Meeting],'Meetings'[2nd Meeting])-1
However some of the 1st meetings in the column are blank so the output become "36789".
How can I format the function to ignore blank start dates.  
Thanks in advance
 
  • MFelix's avatar
    MFelix
    1 year ago

    Hi Elisa112 ,

     

    Do you mean on the visualization level? You just need to select show items with no values for the column you want to have that information:

     

8 Replies

  • Hi Elisa112 ,

     

    From the syntax I believe you are creating a column you can try something similar to this:

     

    Meeting date diff=  IF('Meetings'[1st Meeting]) <> BLANK(), NETWORKDAYS('Meetings'[1st Meeting],'Meetings'[2nd Meeting])-1)

     

     

    • Elisa112's avatar
      Elisa112
      Helper V

      MFelix Thank you, yes I am using  calculated columns, I tried your function, it works but does not show the records with a blank start date, which I still need as there are other subsequent dates which need to be visible for the record.

      Any Ideas?

      Thanks in advance

      • MFelix's avatar
        MFelix
        Super User

        In the first post you refer you want to ignore blank start dates, it seems like what you are writing in this last post is not matching that.

         

        Can you please elaborate on what are the possible results with a example.

  • Elisa112 

    Calculated column


    Meeting date diff =
    IF(
    ISBLANK('Meetings'[1st Meeting]),
    BLANK(),
    NETWORKDAYS('Meetings'[1st Meeting], 'Meetings'[2nd Meeting]) - 1
    )

    💌If this helped, a Kudos 👍 or Solution mark would be great! 🎉
    Cheers,
    Kedar
    Connect on LinkedIn

     

  • Ray_Minds's avatar
    Ray_Minds
    Solution Supplier

    In Power BI, you can handle blank values in your measure or calculated column by using the IF and ISBLANK functions:

     

    1.  ISBLANK('Meetings'[1st Meeting]): Determines if the 1st Meeting column contains a blank value.
    2.  IF statement: If the 1st Meeting is blank, the formula outputs BLANK(). Otherwise, it computes the difference using the NETWORKDAYS function.
    3. Subtracting 1: Adjusts the result by subtracting 1 from the calculated value.

     


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