Forum Discussion
kkirner
Helper II
3 years agoTrouble Calculating the Date Difference between two fields that are the same, but different values
Good morning! I'm relatively new to Power BI. I have a decent understanding of DAX, but have always struggled with the Date/Time calculations. I have a report with multiple tables, but I think wha...
- 3 years ago
Try
Days Diff Title Work to Sign Final Commitment = SUMX ( VALUES ( 'SPSOrder'[Order ID] ), VAR TitleWork = CALCULATE ( MAX ( 'SPSTask'[Completed/Received Date] ), 'SPSTask'[TaskLookupCode] = "TitleWork" ) VAR SignFinalCommitment = CALCULATE ( MAX ( 'SPSTask'[Completed/Received Date] ), 'SPSTask'[TaskLookupCode] = "SgnFnlCom" ) VAR Result = DATEDIFF ( TitleWork, SignFinalCommitment, DAY ) RETURN Result )
kkirner
Helper II
3 years agojohnt75 Thank you! You nailed it. I removed all of the columns other than the Order ID and got the DateDiff results. I appreciate all of your help!
johnt75
Super User
3 years agoIf you need to put them back in the visual you could add REMOVEFILTERS clauses for those columns into the CALCULATE calls.