Forum Discussion
POSPOS
2 years agoPost Partisan
Calculate date difference without aggregating using DAX
Hi All, I have a requirement to calculate the difference between two dates. Please find sample data below: Protocol Start Date Status End Date A 9/26/2022 In-Progress 11/20/2022 A...
- Anonymous2 years ago
Simplest dax can be as follows.
SUMX(SUMMARIZE('Table','Table'[protocol],'Table'[start],'Table'[end],"datediff",DATEDIFF('Table'[start],'Table'[end],DAY)),[datediff]).
This will give you was u required.
Summarize is good approach to avoid certain columns which creates aggregation or double dip on values
Anonymous
2 years agoNot applicable
Simplest dax can be as follows.
SUMX(SUMMARIZE('Table','Table'[protocol],'Table'[start],'Table'[end],"datediff",DATEDIFF('Table'[start],'Table'[end],DAY)),[datediff]).
This will give you was u required.
Summarize is good approach to avoid certain columns which creates aggregation or double dip on values
POSPOS
2 years agoPost Partisan
Anonymous - thank you for the response. This solution worked.
- Anonymous2 years agoNot applicable
You are most welcome:-)