Forum Discussion
samlittleTT
8 years agoNew Member
Calculating date difference across rows with a criteria
Hi, I'm having a little trouble calculating the length of an activity for my project schedules; I am trying to get the number of days between two dates (one the start of Gate 1 and the other the ...
- 8 years ago
Hi samlittleTT,
To achieve your requirement, create a measure using DAX formula like this:
Diff = VAR gate1_start = CALCULATE(MIN('table'[Start Date]), 'table'[Gate Number]= "Gate1") VAR gate2_start = CALCULATE(MIN('table'[Start Date]), 'table'[Gate Number]= "Gate2") RETURN DATEDIFF(gate1_start, gate2_start, DAY)PBIX file here: https://www.dropbox.com/s/yxmkmq1w9bnwffp/Calculating%20date%20difference%20across%20rows%20with%20a%20criteria.pbix?dl=0
Regards,
Jimmy Tao
CoreyP
8 years agoSolution Sage
Why don't you try adding another column, "End Date."
Then, a calculated column with:
Difference =
DATEDIFF(
[Start Date], [End Date], DAY
)