Forum Discussion
acnt_schartner
Helper III
5 years agoUser with max time logged for each ticket-key
Hi, i have a table similar to: Key Worklog ID Time Entry Logged Time Time Entry User key-1 0001 0.25 A key-1 0002 4 A key-1 0003 0.1 B key-2 0004 1 C key-2 0005 ...
- 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] )
Fowmy
Super User
5 years agoacnt_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
Helper III
5 years agoHi, 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"
| Key | Worklog ID | Time Entry Logged Time | Time Entry User |
| key-1 | 0001 | 0.25 | A |
| key-1 | 0002 | 4 | A |
| key-1 | 0003 | 4 | A |
| key-1 | 0004 | 0.1 | B |
| key-1 | 0005 | 0.1 | B |
| key-1 | 0006 | 5 | B |
| key-1 | 0007 | 0.1 | B |
| key-2 | 0008 | 1 | C |
| key-2 | 0009 | 0.5 | C |
- Fowmy5 years ago
Super User
acnt_schartner
Do you need the result by the count of users lines or the Logged Time total?
- acnt_schartner5 years ago
Helper III
I need the user with the biggest sum of the Logged Time
- Fowmy5 years ago
Super User
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] )