0

Calculate the number of days from a date to the current date

Hello,

How do you calculate the number of days from a given date in the model to the current date.  We tried the following but cannot get it to work.

 We consistently get an empty set.

Thanks,
Rob Clark

4 replies

null
    • Redeemed from the Dark Side (Power BI)
    • Obee1
    • 18 hrs ago
    • Reported - view

    Try use the caption of the member and the "dy" day flag. 

    The date member should be set to "currentmember" and the formula should produce a measure. This assumes that the member caption is a well formed date-time text label. 

      • Robert_Clark
      • 1 hr ago
      • Reported - view

       Thank you but we had already tried the .caption on the member and that didn't work.  Changing the flag to "dy" unfortunately didn't work either.  See  reply below.  That way of solving the problem seems to have worked.

       

      Thank you again for helping us.

    • Global Architect
    • Mark_Oldfield.1
    • 11 hrs ago
    • Reported - view

    Hi Rob,

    In addition to Obee's approach, you can implement this as a Custom Column within Formulate and perform this on a row-by-row basis.

    This uses Now() function to return the current date, and at the same time, you can create a measure upon the custom column to provide a relevant aggregation if required.

     

    thanks

     

    Mark.

      • Robert_Clark
      • 1 hr ago
      • Reported - view

      Thanks Mark!  That solved the problem!

Content aside

  • 1 hr agoLast active
  • 4Replies
  • 19Views
  • 3 Following