Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Calculating average chat reply time: Table, grouping and subgrouping based on sequence in chat

Hi, community!

 

I have a few thousand CSV files containing chat conversations. My objective is to calculate the average time between answers from different users (User = the customer, Account = our staff).

 

Here is what the raw data looks like, for one csv file: 

ploubignac_1-1665719292976.png

 

My question is: how could I group the messages that are sent in a "sequence" (meaning sent by the same sender (user or account)) together? 

(My intent is that the sequences would need to have some kind of running number within a conversation, where the chats of a same sequence would have the same running number)

 

My next step would be to create a table that would group first by conversation, then by sender type, and then by "sequence". I would retrieve the min and max timestamp for each of these sequences. Then calculate the time difference between the timestamp of the last message of the previous sequence with the first timestamp of the first message of the next sequence. 

 

I'd be happy to get your input on whether the thinking process is correct and some leads for me to explore grouping messages in sequence (if that's the correct way to go).

 

Also, I'd like to give a big thanks to all the members here. All the information shared has been so useful to me in the past few months when I was trying to figure out ways of using power BI.

 

Thanks for the time and potential leads to resolve this issue.

Cheers

2 REPLIES 2
Anonymous
Not applicable

Excellent! Thanks. I actually used an index. It worked wonders. Thanks for your kind help!

amitchandak
Super User
Super User

@Anonymous , You need to use logic similar to Continuous streak

Continuous streak: https://youtu.be/GdMcwvdwr0o

 

https://community.powerbi.com/t5/Community-Blog/Power-BI-Continuous-Streak-With-One-Day-Break/ba-p/1290346

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors