Forum Discussion
Anonymous
7 years agoNot applicable
Creating unique values table with min / max timestamps
Hi all, I am strugling to create calculation based on unique values from a table. I need to calculate average duration using only unique ID taking earliest and oldest timestamps. One ID should...
- 7 years ago
Hi Anonymous ,
1. You can create measures like so:
Earliest = CALCULATE(MIN('Table 1'[Closed]),ALLEXCEPT('Table 1','Table 1'[ID]))Oldest = CALCULATE(MAX('Table 1'[Created]),ALLEXCEPT('Table 1','Table 1'[ID]))Duration per case = DATEDIFF([Earliest],[Oldest],DAY)
2. Copy “Visual” and remove “Closed” and “Created”, ”Duration” columns, then you will get “Visual 2”.
3. Or, you can create a new table.
Table 3 = ADDCOLUMNS ( VALUES ( 'Table 1'[ID] ), "Earliest", [Earliest], "Oldest", [Oldest], "Duration per case", [Duration per case] )Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Icey
Community Support
6 years agoHi Anonymous ,
Is this problem sloved?
If it is sloved, could you kindly accept it as a solution to close this case?
If not, please let me know.
Best Regards
Icey
- Anonymous6 years agoNot applicable
Hi Icey,
Apologies, thought already did.
Thank you very much for your help, i managed to solve with with your suggestions
Regards
Filarap