Forum Discussion
charlineklapu
3 years agoFrequent Visitor
Measure to finde time difference between two ordered timestamps within one category
Hi all, data looks as followed: Customer Opened on Case Status Timestamp hh:mm:ss 712 18.11.2022 00:00 2100045 In Progress 18.11.2022 07:28 712 18.11....
- 3 years ago
Hi charlineklapu .
According to your description, here is my solution, and please follow these steps.
Firstly, process the data and make sure that your columns "Opened on" and "Timestamp" are Date/time format.
And then use Power Query to add an index column.
And then create a calculated column.
Column = VAR _a = CALCULATE ( MAX ( 'Table'[Timestamp] ), FILTER ( 'Table', [Index] = EARLIER ( 'Table'[Index] ) + 1 ) ) VAR _b = DATEDIFF ( _a, [Timestamp], HOUR ) VAR _c = CALCULATE ( MIN ( 'Table'[Timestamp] ), FILTER ( 'Table', [Customer] = EARLIER ( 'Table'[Customer] ) && [Timestamp] > EARLIER ( 'Table'[Timestamp] ) ) ) RETURN SWITCH ( TRUE (), [Status] = "Request Processed" && ISBLANK ( _c ), "FCR", [Status] = "Request Processed" && _b > 24, "FCR", [Status] = "Request Processed" && _b < 24, "n.FCR" )Final output:
I attach my sample below for your reference.
Best Regards,
Community Support Team _ xiaosunIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
charlineklapu
3 years agoFrequent Visitor
Hi,
thanks for your answer.
How do I set up an Index column while using direct query in an sql analysis server datasource? While using this mode and going into power query editor I see no queries.
Thanks for the help again!