Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago

Business Days Calculation

Hello!

I know that in the past there wasn't really a DAX formula to create the difference in business days between two dates. I was just wondering if in recent updates, maybe there's an easy way to do it? 

 

Thanks,

3 Replies

  • littlemojopuppy's avatar
    littlemojopuppy
    Community Champion

    There is.  In your date table add a column for weekday (easily done using the WEEKDAY() function).  Including/excluding holidays is a little more difficult...

     

    In all the measures you write you'll have to include a FILTER() for where weekday <> Sunday and <>Saturday (refer to the documentation for the weekday function for the exact values to use because it will depend on when what day of week you want to be first).

     

    If you can provide some sample data I can write you a sample measure...

  • v-henryk-mstf's avatar
    v-henryk-mstf
    Community Support

    Hi Anonymous ,

     

    According to your request, I did the following test: first add the Date column to slicer to get the two dates you want, then create a Result measure, VAR min and VAR max parameters to get the corresponding value of the selected date, and finally return result.

    Here is the sample .pbix file.

     

    Best Regards,
    Henry

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.