Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

DATEDIFF - Dates not selectable in the Measure.

I want to calculate the days difference between two dates, So I started a DATDIFF Expression but I cannot get the Two Dates shwoing as a selection.   The Dates are named as so. Any ide...
  • halfglassdarkly's avatar
    2 years ago

    Your measure needs to know which tables to find the columns in and you need to tell it what aggregation context to use. You could try something like:

     

    Difference =
    VAR ConfirmedD = SELECTEDVALUE('Table Name'[Confirmed Date])

    VAR CompletedD = SELECTEDVALUE('Table Name'[Completed Date])

    RETURN

    DATEDIFF(ConfirmedD,CompletedD,DAY)