Forum Discussion
villa1980
1 year agoResolver II
Time Duration between rows
I am trying to look at the duration between the end date and next start date for each STARTDATE category. I am using the below DAX and is coming out with some weird results which I am struggling to ...
ryan_mayu
1 year agoSuper User
is this what you want?
Measure =
VAR _end=maxx(FILTER(ALL('Table'),'Table'[CENTERID]=max('Table'[CENTERID])&&'Table'[ENDDATE]<max('Table'[ENDDATE])),'Table'[ENDDATE])
return DATEDIFF(_end,max('Table'[STARTDATE]),MINUTE)
pls see the attachment below
villa1980
1 year agoResolver II
ooh getting closer, these is what it returns. Not sure why it has -30 on the other rows
I did attach a link to the pbix, maybe it is that?
- ryan_mayu1 year agoSuper User
since you have the index column , you can try this
Measure =var _end=maxx(FILTER(all('Table'),'Table'[BAYDESC]=max('Table'[BAYDESC])&&'Table'[Index]=max('Table'[Index])-1),'Table'[ENDDATE])return DATEDIFF(_end,max('Table'[STARTDATE]),MINUTE)- villa19801 year agoResolver II
wow, you have hit the nail on the head with this, works an absolute treat, thank-you so much.
I have a couple of questions if you don't mind...1) If I wanted to do this for start date as a group, how would I add that?
2) In simple speak could you explain what it does 🙂