Forum Discussion
BilboBaggins
8 years agoFrequent Visitor
Days between based on slicer
Greetings! I have table that has several lines of startdate and enddate. I can easily calculate a new colun that shows the number of days between startdate and enddate, but in the next step I'm bi...
- Anonymous8 years ago
BilboBaggins,
You can create the following measure. For more details, please check attached PBIX file.Datediff = var maxslicer=MAX('Date'[Date]) var minslicer=MIN('Date'[Date]) return CALCULATE( DATEDIFF( IF(MAX(person[startDate]) < minslicer;minslicer;MAX(person[startDate])); IF(MAX(person[endDate]) > maxslicer;maxslicer;MAX(person[endDate]) ); DAY) )
Regards,
Lydia
Anonymous
8 years agoNot applicable
BilboBaggins,
You can create the following measure. For more details, please check attached PBIX file.
Datediff = var maxslicer=MAX('Date'[Date]) var minslicer=MIN('Date'[Date]) return CALCULATE(
DATEDIFF(
IF(MAX(person[startDate]) < minslicer;minslicer;MAX(person[startDate]));
IF(MAX(person[endDate]) > maxslicer;maxslicer;MAX(person[endDate]) );
DAY)
)
Regards,
Lydia
- BilboBaggins8 years agoFrequent Visitor
Thanks Lydia, you made my day! :smileyvery-happy: