Forum Discussion

Paco's avatar
Paco
Frequent Visitor
10 years ago
Solved

DAX Function

Hello, I´m trying to get the days from the first day of the month until TODAY (function). In Excel I use WORKDAY.INTL but I don´t know which DAX Function to use or if it´s posible.  

 

 

What I´m trying to get is my daily sales. Example= 100,000/8 . I want to ge the 8 automatically, in this example there are 8 days between apr-1-2016  and apr-9-2016 because I´m not considering Sundays.

7 Replies

  • Sean's avatar
    Sean
    Community Champion

    Paco Try this... Let me know if it works

     

    Number of Days = DATEDIFF ( STARTOFMONTH(Table1[Date]), ENDOFMONTH(Table1[Date]), DAY)

     

    • Paco's avatar
      Paco
      Frequent Visitor

      I really appreciate you quickly answer, I try the function and it's working, theres is only one missing, It's counting Sundays and I don't want to count them. 

       

      In Excel the formula WORKDAY.INTL(start_date, days, [weekend], [holidays]) I have to enter 11 inside [holidays] to not to count sundays. 

       

      If I use the function Number of Days = DATEDIFF(DATEVALUE("04/01/2016"),TODAY(),DAY)+1  the result is 21 and I need 18 because there are 3 sundays that I don't want to count, 

       

      Thank you!! :D 

       

      Note: An apology if there is some misspelling but I´m from Mexico :D :S