Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Days Between Dates Issue

Hello,   I am attempting to calculate the days between two dates (using a calculated column), which is easy! However, I am returning incorrect values. See below screenshot: For the selected ...
  • v-zhangti's avatar
    4 years ago

    Hi, Anonymous 

     

    You can solve your problem with measure, mainly because you need to calculate the second date.

    Maesure:

    Days between date =
    DATEDIFF (
        DATE ( YEAR ( TODAY () ), 1, 1 ),
        DATE ( YEAR ( TODAY () ), SELECTEDVALUE ( 'Date'[Date].[MonthNo] ) + 1, 1 ) - 1,
        DAY
    )
    

    Is this the result you expect?

     

    Best Regards,

    Community Support Team _Charlotte

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.