Forum Discussion
Stabben23
4 years agoHelper I
Date Variable wrong format
Hi, I want to create a variable in my DAX formula. Var = maxdate= max(DateTable[Date])-7, this should gives me the maxdate from selected slicer in YYYY-MM-DD format but it gives me a numeric val...
Samarth_18
4 years agoCommunity Champion
HI Stabben23 ,
You can try below code:-
Measure =
VAR selected_date =
SELECTEDVALUE ( table[date] )
VAR maxx_date =
DATEVALUE ( FORMAT ( selected_date - 7, "YYYY-MM-DD" ) )
RETURN
maxx_dateThanks,
Samarth