Forum Discussion

Syndicate_Admin's avatar
Syndicate_Admin
Administrator
3 years ago
Solved

DATE

Good afternoon

I need to calculate the time that has elapsed from 1/01/2023 to today in PowerBi, what work should I do to obtain this calculation.

the idea is to calculate the LEADTime of a Purchase Order.

I appreciate it very much

  • DOLEARY85's avatar
    DOLEARY85
    3 years ago

    You can try using values for a measure something like:

     

    Measure = DATEDIFF(VALUES('Table'[ORDER DATE]),VALUES('Table' [TODAY- DATE or Delivery Date]),DAY)
     
    or if you want a calculated column:
     
    Column = DATEDIFF('Table'[ORDER DATE],'Table' [TODAY- DATE or Delivery Date],DAY)
     
    If I answered your question, please mark my post as solution, Appreciate your Kudos 👍
     

3 Replies

  • DOLEARY85's avatar
    DOLEARY85
    Resident Rockstar

    Hi,

     

    Assuming your date is in a date field, you could create a calculated column with a date diff calc, such as:

     

    Column = DATEDIFF('Table'[Date Field],today(),DAY)
     

     


    If I answered your question, please mark my post as solution, Appreciate your Kudos 👍

  • Is there any measure to do this?

    I have column ORDER DATE, and another column TODAY- DATE or Delivery Date.

    • DOLEARY85's avatar
      DOLEARY85
      Resident Rockstar

      You can try using values for a measure something like:

       

      Measure = DATEDIFF(VALUES('Table'[ORDER DATE]),VALUES('Table' [TODAY- DATE or Delivery Date]),DAY)
       
      or if you want a calculated column:
       
      Column = DATEDIFF('Table'[ORDER DATE],'Table' [TODAY- DATE or Delivery Date],DAY)
       
      If I answered your question, please mark my post as solution, Appreciate your Kudos 👍