Forum Discussion
ravi_ch
4 years agoHelper I
How can we calculate dates difference
How can we calculate no. of days between two days like 2/12/2020 - 2/20/2020 = 8, 2/20/2020 - 3/24/2020 = 32 like this
ravi_ch
4 years agoHelper I
but apply slicer like product mam it won't working.
like for each Product what is difference in days between each sale
- ryan_mayu4 years agoSuper User
Pls try this
Measure = VAR _last=maxx(FILTER(ALL('Table'),'Table'[Date]<max('Table'[Date])),'Table'[Date]) VAR _DF= DATEDIFF(_last,max('Table'[Date]),DAY) VAR _last2=maxx(FILTER(ALL('Table'),'Table'[Date]<max('Table'[Date])&&'Table'[Product]=max('Table'[Product])),'Table'[Date]) VAR _DF2=DATEDIFF(_last2,max('Table'[Date]),DAY) RETURN IF(ISFILTERED('Table'[Product]),_DF2,_DF)pls see the attachment below.