locked
DAX - Future date calculation (calendar days) RRS feed

  • Question

  • Hi all,

    Need help with a calculated column to create a future date.  I have my Start Date and Days Allowed column.

    How do I create the Due Date column below?  Thank you!

    ~UG1

    Employee Start Date Days Allowed Due Date
    1 5/1/2015 10 5/11/2015
    2 5/10/2015 12 5/22/2015

    • Edited by undergrads1 Friday, May 22, 2015 11:55 AM Qualified my question by "calendar days"
    Thursday, May 21, 2015 7:28 PM

Answers

  • Hi undergrads1,

    Assuming that you've set the data types for 'Start Date' to be Date and for 'Days Allowed' to be Whole Number, you should be able to define the Calculated Column as:

    =TableName[Start Date] + TableName[Days Allowed]


    Regards,

    Michael Amadi

    Please use the 'Mark as answer' link to mark a post that answers your question. If you find a reply helpful, please remember to vote it as helpful :)

    Website: http://www.nimblelearn.com, Twitter: @nimblelearn

    • Marked as answer by undergrads1 Friday, May 22, 2015 12:50 AM
    • Unmarked as answer by undergrads1 Friday, May 22, 2015 2:05 AM
    • Marked as answer by undergrads1 Friday, May 22, 2015 11:52 AM
    Thursday, May 21, 2015 8:36 PM

All replies

  • Hi undergrads1,

    Assuming that you've set the data types for 'Start Date' to be Date and for 'Days Allowed' to be Whole Number, you should be able to define the Calculated Column as:

    =TableName[Start Date] + TableName[Days Allowed]


    Regards,

    Michael Amadi

    Please use the 'Mark as answer' link to mark a post that answers your question. If you find a reply helpful, please remember to vote it as helpful :)

    Website: http://www.nimblelearn.com, Twitter: @nimblelearn

    • Marked as answer by undergrads1 Friday, May 22, 2015 12:50 AM
    • Unmarked as answer by undergrads1 Friday, May 22, 2015 2:05 AM
    • Marked as answer by undergrads1 Friday, May 22, 2015 11:52 AM
    Thursday, May 21, 2015 8:36 PM
  • Thanks, Michael!  My error was in the data types.  This worked. 

    Best, 

    ~UG1

    Friday, May 22, 2015 12:50 AM
  • Michael (or anyone else), 

    Apologies, one more question.  My example counts by calendar days, obviously.  

    Is it possible to count by business days...and excluding holidays, too?  (Just assume my [Days Allowed] = business days.)

    Thanks,

    ~UG1


    Friday, May 22, 2015 2:04 AM
  • Hi UG1,

    Can you perhaps clarify this further with another example?


    Regards,

    Michael Amadi

    Please use the 'Mark as answer' link to mark a post that answers your question. If you find a reply helpful, please remember to vote it as helpful :)

    Website: http://www.nimblelearn.com, Twitter: @nimblelearn

    Friday, May 22, 2015 9:39 AM
  • Sorry....I will start a new thread and close this one to keep things clear.

    Thanks,

    ~UG1

    Friday, May 22, 2015 11:52 AM
  • Michael (or anyone else), 

    Apologies, one more question.  My example counts by calendar days, obviously.  

    Is it possible to count by business days...and excluding holidays, too?  (Just assume my [Days Allowed] = business days.)

    Thanks,

    ~UG1


    Hi UG1,

    Since there is no equivalent NETWORKDAYS function in DAX, we can easily create an equivalent measure in PowerPivot. Create a Calendar table in SQL Server Database as reference and then import it as a linked table in PowerPivot. Please refer to the link below.
    http://visakhm.blogspot.in/2010/02/generating-calendar-table.html

    Regards,


    Charlie Liao
    TechNet Community Support

    Tuesday, May 26, 2015 9:10 AM