Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Aggregate, Sort the data -> Calculate score

Sample pbix file link:

https://we.tl/t-TM2i36iWpY

 

I'm struggling with creating a PairScore column as shown in the screenshot below. Consider this table as a chat room log data where user A and B are sending message to each other.

 

Here is a logic:
(a) Aggregate the data by RoomID (Chat room) and Sort it by Date (with Ascending order).

(b) PairScore starts with 0.5. And it stays as 0.5 until the opposite user replies, which is then added 0.5 => Thus, it becomes 1. And it repeats...

 

I've struggled with this calculated column for days. Can someone please help? Thank you so much.

 

 

9 Replies

    • Anonymous's avatar
      Anonymous
      Not applicable

      YOU ARE THE HERO THANK YOU SO MUCH

      • Anonymous's avatar
        Anonymous
        Not applicable

        amitchandak  Unfortunately I found an error on this method. As shown in the screenshot below, it needs to become 1 when client replies to partner's first message, and then becomes 1.5 when partner replies. Therefore, Final measure needs to be 1.5 

        I really appreciate your time but would you please help? THanks!

         

         

         

  • Anonymous , In case you need pairscore

    You can try measure like

    countx(allselected(Table), Table[roomID] = max(Table[RoomID]) && Table[Date] <= max(Table[Date])) *.5

     

    otherwise

    Can you please share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Here is a sample data! https://we.tl/t-920BuxuX7U 

      I tried your method but it looks like the measure doesn't take the date column... 

      • amitchandak's avatar
        amitchandak
        Super User

        Anonymous , Create a date column from created_at, is has a time stamp

         

        Date = [created_at].date

        or

        Date = date(year([created_at]),month([created_at]),day([created_at]))

         

        You can try the same formula with correct column names