Forum Discussion
Maintain high level ranking when drilling down
Hi.
I am trying to drill down a chart that was built based on Top N personnel with overtime. So I have a 'Select N' filter and I also have a filter on date. I would like to show top N personnel with the most overtime for 3 months cumulative. So I'll select 3 months from the date filter. I have the following measures:
- Anonymous5 years ago
After many hours of research I was able to find a simple solution to my problem.
Measure 1
Total OT = CALCULATE( SUM( 'Data'[Hours]), ALLSELECTED('Data'[Date]))Measure 2
Rank OT = RANKX ( ALLSELECTED ('Data'[Name]), CALCULATE ( [Total OT] ), , DESC, Dense )Measure 3
Employee Rank = IF [Rank OT] <= [Selected N], "True", "False")
3 Replies
- v-cazheng-msft
Community Support
Hi Anonymous
Can you provide some sample removing sensitive data?
Best Regards,
Caiyun Zheng
- AnonymousNot applicable
hi, suppose I have three columns: Name, Date and overtime and I wanted the top 3 persons for April, May and June cumulatively. The pivot table shows the ranking I would expect to see even if I drill down to see the trend of the 3 months.
Name Month/Year Overtime
John 1/1/2020 70
John 2/1/2020 35
John 3/1/2020 42
John 4/1/2020 61
John 5/1/2020 53
John 6/1/2020 13
David 1/1/2020 73
David 2/1/2020 45
David 3/1/2020 66
David 4/1/2020 13
David 5/1/2020 2
David 6/1/2020 1
Samantha 1/1/2020 10
Samantha 2/1/2020 48
Samantha 3/1/2020 17
Samantha 4/1/2020 4
Samantha 5/1/2020 3
Samantha 6/1/2020 49
Rose 1/1/2020 5
Rose 2/1/2020 2
Rose 3/1/2020 8
Rose 4/1/2020 5
Rose 5/1/2020 4
Rose 6/1/2020 10
Mark 1/1/2020 14
Mark 2/1/2020 6
Mark 3/1/2020 6
Mark 4/1/2020 20
Mark 5/1/2020 10
Mark 6/1/2020 6
- AnonymousNot applicable
After many hours of research I was able to find a simple solution to my problem.
Measure 1
Total OT = CALCULATE( SUM( 'Data'[Hours]), ALLSELECTED('Data'[Date]))Measure 2
Rank OT = RANKX ( ALLSELECTED ('Data'[Name]), CALCULATE ( [Total OT] ), , DESC, Dense )Measure 3
Employee Rank = IF [Rank OT] <= [Selected N], "True", "False")