Forum Discussion
gauravnarchal
5 years agoPost Prodigy
Date Diff DAX
Hello I need to create a calculation formula to get If the days between the Ship date and the return date is between 0-2 days return “0-02 Days” If the days between the Ship date and the re...
- 5 years ago
Hi gauravnarchal ,
create a calculated column with this DAX formula.Diff = VAR diff = DATEDIFF ( 'Table'[Ship Date], 'Table'[Return Date], DAY ) RETURN SWITCH ( TRUE (), diff >= 0 && diff <= 2, "0-02 Days", diff >= 3 && diff <= 7, "03-07 Days", diff >= 8 && diff <= 14, "08-14 Days", diff >= 15 && diff <= 21, "15-21 Days", diff >= 22 && diff <= 30, "22-30 Days", diff > 30, "above 31 Days", BLANK () )
mwegener
5 years agoMost Valuable Professional
Hi gauravnarchal ,
create a calculated column with this DAX formula.
Diff =
VAR diff =
DATEDIFF ( 'Table'[Ship Date], 'Table'[Return Date], DAY )
RETURN
SWITCH (
TRUE (),
diff >= 0
&& diff <= 2, "0-02 Days",
diff >= 3
&& diff <= 7, "03-07 Days",
diff >= 8
&& diff <= 14, "08-14 Days",
diff >= 15
&& diff <= 21, "15-21 Days",
diff >= 22
&& diff <= 30, "22-30 Days",
diff > 30, "above 31 Days",
BLANK ()
)