Forum Discussion

rsch91's avatar
rsch91
Helper I
1 year ago
Solved

NETWORKDAYS() not excluding holidays

Hi, 

 

I have the following piece of DAX:

 

VAR tabel_vakantiedagen = CALCULATETABLE(
                                SELECTCOLUMNS(Dim_Datum, "Feestdag", Dim_Datum[Datum]),
                                Dim_Datum[IsFeestdag] = 1)

RETURN NETWORKDAYS([Datum gereedgemeld], [Datum factuur], 1, tabel_vakantiedagen) - 1
 
But it's not properly excluding the holidays. How do I bug fix?
  • Found the solution. It applied the filter context of the table it was in while it had to ignore it. Just added ALL(Dim_Datum[Datum]) and it worked. 

9 Replies

  • BeaBF's avatar
    BeaBF
    Super User

    rsch91 Hi! try with:

    VAR tabel_vakantiedagen =
    CALCULATETABLE(
    SELECTCOLUMNS(Dim_Datum, "Datum", Dim_Datum[Datum]), -- Use "Datum" instead of "Feestdag"
    Dim_Datum[IsFeestdag] = 1
    )

    RETURN NETWORKDAYS([Datum gereedgemeld], [Datum factuur], 1, tabel_vakantiedagen) - 1

     

    BBF

    • rsch91's avatar
      rsch91
      Helper I

      Thank you, it doesn't work unfortunately 😞

  • Found the solution. It applied the filter context of the table it was in while it had to ignore it. Just added ALL(Dim_Datum[Datum]) and it worked.