Forum Discussion
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 idea why they are not showing automatically? Is it because its a Date and not date & time.
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)
2 Replies
- halfglassdarkly
Responsive Resident
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)
- manvishah17
Solution Supplier
Hey Anonymous , can you give values for your column you want to use.
Till then refer this for Datediff Dax
https://learn.microsoft.com/en-us/dax/datediff-function-dax