Power BI Exchange

Please login or click SIGN UP FOR FREE to create your PowerBIUG account to join this user group.
Expand all | Collapse all

Date difference with Datediff

  • 1.  Date difference with Datediff

    Posted 24 days ago
    Edited by Andreas Richter 24 days ago
    Hello,

    I have now spent two hours trying to calculate the difference between a fixed date and "today".

    The whole thing works also in principle but instead of the correct number of months I get a wrong result. It seems to me that it is not the formula but the format of the date (14.09.2020). But I could not find a format with which it worked.

    Andreas

    wrong result


    ------------------------------
    Andreas Richter
    ------------------------------


  • 2.  RE: Date difference with Datediff

    Top Contributor
    Posted 24 days ago
    Hi Andreas:

    You can do it more than one way. But to use a date it goes like this  DATE(2021, 9, 24)

    Here's a couple other examples
    Time Since Last Interview = INT(TODAY() - [Last Date])   - here Last Date was a measure

    DATESBETWEEN(Dates[Date], DATE( y, m, d), DATE(y, m, d)

    To use in a measure example:
    Days Between = CALCULATE([Day Count],
    DATESBETWEEN(DATES[Date], [First Date],
    [Last Date])
    )

    I hope this helps!


    ------------------------------
    William Skelley
    01106
    Longmeadow MA
    8602807221
    ------------------------------



  • 3.  RE: Date difference with Datediff

    Posted 24 days ago
    Hi William,

    thank you, that helps me a lot! Also your other examples I can perhaps still use well.

    Andreas

    ------------------------------
    Andreas Richter
    ------------------------------