Forum Discussion

PowerBI123456's avatar
PowerBI123456
Post Partisan
5 years ago
Solved

First User Touch

I am trying to determine the first user to touch an account and to exclude any automate touches. For example, below is my data. For account 1, the first user should be Bob and for account 2, the first user should be Jim. I am dealing with millions of rows so anyway to do this in a measure? Thanks!

 

AccountUserActivityIndex
1AnnSell1
1BobBuy2
1AutomateSell3
2CallySell4
2SamBuy5
2JimSell6
  • amitchandak's avatar
    amitchandak
    5 years ago

    PowerBI123456 , Try a new measure like 

    measure = calculate(sum(Table[Index]), filter(Table,Table[Index] = calculate(max(Table[Index]), allexpcept(Table,table[Account]), table[Activity] <> "Automate")))

3 Replies

    • PowerBI123456's avatar
      PowerBI123456
      Post Partisan

      amitchandak Looking at the index. First user who has the greatest index per account and that user cannot be "automate". Does that help?

      • amitchandak's avatar
        amitchandak
        Super User

        PowerBI123456 , Try a new measure like 

        measure = calculate(sum(Table[Index]), filter(Table,Table[Index] = calculate(max(Table[Index]), allexpcept(Table,table[Account]), table[Activity] <> "Automate")))