Forum Discussion
Calculate date difference between different meeting types which are stored in the same column
is this what you want?
Table 2 = ADDCOLUMNS( ADDCOLUMNS(SUMMARIZE('Table','Table'[UserID ]),"introdate",maxx(FILTER('Table','Table'[UserID ]=[UserID ] && 'Table'[MeetingType]="Intro"),'Table'[Meetingdate]),"assessdate",maxx(FILTER('Table','Table'[UserID ]=[UserID ] && 'Table'[MeetingType]="Assess"),'Table'[Meetingdate])),"datedif",DATEDIFF([introdate],[assessdate],day))
pls see the attachment below
ryan_mayu thank you, your solution is bringing back the same dates and times for all users eg
Any ideas on why, I assume because i do not have a calendar set up for testing but if you have any other suggestions, greatly appreciated. Im getting closer to solving this and I think your solution will work with some tweaking.
Thanks in advance
- ryan_mayu2 years ago
Super User
modify the DAX, pls try this
Table 2 = ADDCOLUMNS( ADDCOLUMNS(SUMMARIZE('Table','Table'[UserID ]),"introdate",maxx(FILTER('Table','Table'[UserID ]=EARLIER([UserID ] )&& 'Table'[MeetingType]="Intro"),'Table'[Meetingdate]),"assessdate",maxx(FILTER('Table','Table'[UserID ]=earlier([UserID ] )&& 'Table'[MeetingType]="Assess"),'Table'[Meetingdate])),"datedif",DATEDIFF([introdate],[assessdate],day))pls see the attachment below- Elisa1122 years ago
Helper V
Hello ryan_mayu
I tinkered a little bit more and it works!
The problem I need to figure out is how to bring back only the first attended meeting for any meeting type. I am so pleased to have got this far, do you think I need to change the maxx filter to min as I dont think I can add another expression to the filter. any further help appreciated,
thank you