Forum Discussion

jonnyA's avatar
jonnyA
Icon for Responsive Resident rankResponsive Resident
5 years ago
Solved

Formula for Days back minus 2 days from current date

Hey!

I'm hoping someone can help me come up with a formula for "Days back minus 2 (From current date)".  Not sure if you will need the current "Fields" i was given in the dataset, but here they are ... 

Thank you in advance! 🙂

  • Hey jonnyA ,

     

    depends on what exactly you are doing.

    You can just use your date and do a minus 2, for example as a calculated column:

    Day before yesterday = myTable[Date] - 2

     

    To calculate the date proper I would use the DATEADD function:

    DATEADD ( DateTable[Date] , -2, DAY )  

     

    If you need any help please let me know.
    If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
     
    Best regards
    Denis
     
  • Today - 2 = TODAY() - 2
     
    The measure above on this text ended up working for me!  But the one you gave me helped me get going ion figuring it out, so thank you!

3 Replies

  • selimovd's avatar
    selimovd
    Icon for Most Valuable Professional rankMost Valuable Professional

    Hey jonnyA ,

     

    depends on what exactly you are doing.

    You can just use your date and do a minus 2, for example as a calculated column:

    Day before yesterday = myTable[Date] - 2

     

    To calculate the date proper I would use the DATEADD function:

    DATEADD ( DateTable[Date] , -2, DAY )  

     

    If you need any help please let me know.
    If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
     
    Best regards
    Denis
     
  • jonnyA's avatar
    jonnyA
    Icon for Responsive Resident rankResponsive Resident
    Today - 2 = TODAY() - 2
     
    The measure above on this text ended up working for me!  But the one you gave me helped me get going ion figuring it out, so thank you!
    • selimovd's avatar
      selimovd
      Icon for Most Valuable Professional rankMost Valuable Professional

      Hey jonnyA ,

       

      that's great news! I'm happy you could solve it.

      Can you mark my post as solution if it helped you to find the right formula? This makes it easier for the next person to find the right path for a similar problem.

       

      If you need any help please let me know.
       
      Best regards
      Denis