Forum Discussion
JorgeMolano
4 years agoFrequent Visitor
Date Diff using date Filter
Hi community, I want to create a measure that calculate the days between the oldest date of my table and a day selection based on date filter. For insance, using the table below, the oldest date...
- Anonymous4 years ago
Hi JorgeMolano
What if no selection in the slicer? What do you want to display, the blank? Modify the table and column name accordingly
test = VAR CurDate=SELECTEDVALUE(DateTable[Dates]) VAR MinDate = MINX(ALL(DateTable[Dates]),DateTable[Dates]) RETURN DATEDIFF(MinDate,CurDate,DAY)
v-henryk-mstf
4 years agoCommunity Support
Hi JorgeMolano ,
Based on your description, try the following formula.
M_ =
VAR a =
CALCULATE ( MIN ( 'Table'[Date] ), ALL ( 'Table'[Date] ) )
VAR sel_b =
SELECTEDVALUE ( 'Table'[Date] )
RETURN
DATEDIFF ( a, sel_b, DAY )
If the problem is still not resolved, please point it out. Looking forward to your feedback.
Best Regards,
Henry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.