Custom column for different days

62 views Asked by At

I'm using DirectQuery and i want to calculate the start date - end date without the weekend (Friday and Saturday) through a custom column. Can you help me?

I want you to solve the problem according to the specifications I told you

1

There are 1 answers

11
Sam Nseir On BEST ANSWER

Refer to the DAX NETWORKDAYS function.

It would look similar to:

My New Column = NETWORKDAYS([start date], [end date], 7)

And if it doesn't work for DirectQuery, then you will need to use a Measure instead. That could like this:

My New Measure = 
  var r = SUMX(
    'Your Table Name',
    NETWORKDAYS( [start date], [end date], 7 )
  ) 
  return IF( r < 0, 0, r)