Forum Discussion
gauravnarchal
6 years agoPost Prodigy
Date Difference
I need help with the measure to calculate the date difference between two dates in a table. Once I have the days calculated, I then need to get the results as how many items were shipped between ...
- Anonymous6 years ago
Hi gauravnarchal ,
Check the following measures.
Measure = var datediff = DATEDIFF(SELECTEDVALUE('Table'[booking date]),SELECTEDVALUE('Table'[shipped date]),DAY) return SWITCH(TRUE(),datediff>=1&&datediff<=7,"1-7",datediff>=8&&datediff<=10,"8-10",datediff>=11&&datediff<=13,"11-13",datediff>=13,"13&more") Measure 2 = CALCULATE(DISTINCTCOUNT('Table'[id]),FILTER('Table',[Measure]=SELECTEDVALUE(days[days])))Result would be shown as below.
Best Regards,
Jay
jairoaol
6 years agoImpactful Individual
the difference in days can be calculated with a measure as explained by previous colleagues with the Datediff() function, but to be able to use day ranges to plot is better a calculated column or table.