Forum Discussion
Anonymous
4 years agoNot applicable
DATEDIFF between 2 dates in different tables
Hi this is my very first post and hoping someone can guide me in the right direction. I'm trying to ascertain the DATEDIFF in minutes between 2 dates that are held in different tables. My first ...
- 4 years ago
Anonymous
Please use
Minutes = SUMX ( CROSSJOIN ( SUMMARIZE ( 'Link Table', dim_date[Date], dim_date[Year] ), SUMMARIZE ( 'Link Table', 'Link Table'[dim_professional_carer_key], 'Link Table'[dim_service_points_key] ) ), CALCULATE ( DATEDIFF ( SELECTEDVALUE ( 'fact_service_point_sessions'[START_DTTM] ), SELECTEDVALUE ( 'fact day therapy theatre events'[Earliest Date] ), MINUTE ), 'fact day therapy theatre events'[First Patient] = "First" ) )
Anonymous
4 years agoNot applicable
Hi Tamer
Thanks for responding.
Below is an expanded matrix showing the measure I'm expecting for the example I gave above.
But if I collapse any portion of the matrix it doesnt aggregate my measure.
- tamerj14 years ago
Community Champion
Anonymous
Please use
Minutes = SUMX ( CROSSJOIN ( SUMMARIZE ( 'Link Table', dim_date[Date], dim_date[Year] ), SUMMARIZE ( 'Link Table', 'Link Table'[dim_professional_carer_key], 'Link Table'[dim_service_points_key] ) ), CALCULATE ( DATEDIFF ( SELECTEDVALUE ( 'fact_service_point_sessions'[START_DTTM] ), SELECTEDVALUE ( 'fact day therapy theatre events'[Earliest Date] ), MINUTE ), 'fact day therapy theatre events'[First Patient] = "First" ) )- Anonymous4 years agoNot applicable
Thank you so much for all your help Tamer. I couldn't have done it without you.