Forum Discussion

acnt_schartner's avatar
acnt_schartner
Icon for Helper III rankHelper III
5 years ago
Solved

User with max time logged for each ticket-key

Hi, i have a table similar to:

 

KeyWorklog IDTime Entry Logged TimeTime Entry User
key-100010.25A
key-100024A
key-100030.1B
key-200041C
key-200050.5C

 

I need a column or measure that gives me the user who has logged the most time on a ticket-key. I.e. for "key-1" it should be "A" and for "key-2" it should be "C"

  • Fowmy's avatar
    Fowmy
    5 years ago

    acnt_schartner 

    You can make a minor change to add SUM on Logged Time:

    Max Key = 
    MAXX(
        TOPN(
            1,
            ADDCOLUMNS(
                VALUES(Table5[Time Entry User]),
                "C", CALCULATE( SUM(Table5[Time Entry Logged Time]))
            ),
            [C],DESC
        ),
        Table5[Time Entry User]
    )

6 Replies

  • acnt_schartner 

    Create a measure as follows:

    Max Key = 
    MAXX(
        TOPN(
            1,
            ADDCOLUMNS(
                VALUES(Table5[Time Entry User]),
                "C", CALCULATE( COUNT(Table5[Time Entry User]))
            ),
            [C],DESC
        ),
        Table5[Time Entry User]
    )
    

     



    • acnt_schartner's avatar
      acnt_schartner
      Icon for Helper III rankHelper III

      Hi, i think this works in this case, but i do not see you using "Time Entry Logged Time" anywhere.

      If i am thinking correctly "Count(Table5[Time Entry User]" just shows who created the most worklog entries per key. User "B" could have created more entries and have single entries with more logged time than "A". but "A" could have a bigger sum total of "Time Entry Logged Time" than user "B"


      KeyWorklog IDTime Entry Logged TimeTime Entry User
      key-100010.25A
      key-100024A
      key-100034A
      key-100040.1B
      key-100050.1B
      key-100065B
      key-100070.1B
      key-200081C
      key-200090.5C
      • Fowmy's avatar
        Fowmy
        Icon for Super User rankSuper User

        acnt_schartner 

        Do you need the result by the count of users lines or the Logged Time total?
         

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi acnt_schartner,

    Did Fowmy 's suggestions help with your scenario? if that is the case, you can consider Kudo or accept the helpful suggestions to help others who faced similar requirements to find it more quickly.

    If these also don't help, please share more detailed information to help us clarify your scenario to test.

    How to Get Your Question Answered Quickly 

    Regards,

    Xiaoxin Sheng