Forum Discussion
DATEDIFF as DAX Measure
- 6 years ago
You could try either of these measure expressions
TimeDiff = SUMX(Table, Table[TimeColumn1] - Table[TimeColumn2]
or
TimeDiff = SUMX(Table, DATEDIFF(Table[TimeColumn1], Table[TimeColumn2], MINUTE))If you make a table visual with both time columns, you should see the difference when you add the measure. Or you could use the aggregate, maybe switching to AVERAGEX, MAXX, etc. depending on what you are looking for.
Also, there are probably more impactful ways to reduce the file size of your model.
If this works for you, please mark it as the solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat
Anonymous , in Measure you need to
measure = max([Date1]) -min([Date2])
Take care row context while using. refer this blog how summarize and valuea has been used
Hello, hoping you can read my last reply and provide some assistance please. I have a hard deadline for this project and I'm really trying to deliver it. Thank you!
- mahoneypat6 years ago
Microsoft Employee
You could try either of these measure expressions
TimeDiff = SUMX(Table, Table[TimeColumn1] - Table[TimeColumn2]
or
TimeDiff = SUMX(Table, DATEDIFF(Table[TimeColumn1], Table[TimeColumn2], MINUTE))If you make a table visual with both time columns, you should see the difference when you add the measure. Or you could use the aggregate, maybe switching to AVERAGEX, MAXX, etc. depending on what you are looking for.
Also, there are probably more impactful ways to reduce the file size of your model.
If this works for you, please mark it as the solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat
- Anonymous6 years agoNot applicable
Second measure worked using MAXX. Thank you very much!!!
Additionally, could you tell me what are the best ways to substantially reduce file size?