Forum Discussion
Customization to be achieved: (n) + Dynamic TOP(m) + Others
Hi,
I have not been able to implement one of the common functionality in Power BI.
Customization to be achieved: (n) + TOP(m) + Others
n = Static (Emp3, Emp4 and Emp6)
m = Variable (TOP 1 from remaining Emp). Dynamically calculated based on slicer value
Others = All remaining Emp to be grouped as "Others"
Input:
TableName: EmpTable
| EmpID | EmpName | WorkLocation | LogDate |
| 1 | Emp1 | Loc1 | 1-Apr-2020 |
| 1 | Emp1 | Loc2 | 2-Apr-2020 |
| 1 | Emp1 | Loc1 | 1-Apr-2020 |
| 1 | Emp1 | Loc3 | 3-Apr-2020 |
| 1 | Emp1 | Loc4 | 1-Apr-2020 |
| 2 | Emp2 | Loc2 | 1-Apr-2020 |
| 2 | Emp2 | Loc3 | 2-Apr-2020 |
| 2 | Emp2 | Loc4 | 3-Apr-2020 |
| 2 | Emp2 | Loc3 | 3-Apr-2020 |
| 2 | Emp2 | Loc3 | 3-Apr-2020 |
| 3 | Emp3 | Loc2 | 1-Apr-2020 |
| 3 | Emp3 | Loc2 | 2-Apr-2020 |
| 3 | Emp3 | Loc2 | 2-Apr-2020 |
| 4 | Emp4 | Loc3 | 1-Apr-2020 |
| 4 | Emp4 | Loc1 | 2-Apr-2020 |
| 5 | Emp5 | Loc2 | 2-Apr-2020 |
| 5 | Emp5 | Loc3 | 3-Apr-2020 |
| 5 | Emp5 | Loc1 | 3-Apr-2020 |
| 6 | Emp6 | Loc2 | 1-Apr-2020 |
| 6 | Emp6 | Loc2 | 3-Apr-2020 |
| 7 | Emp7 | Loc4 | 1-Apr-2020 |
Output:
Need to display in "Clustered Bar Chart", EmpNames and Distinct count of EmpID based on slicer value in WorkLocation and LogDate
| LogDate | 2-Apr-2020 | LogDate | 4/1/2020,4/2/2020 | LogDate | 1-Apr-2020 | ||
| WorkLocation | Loc2, Loc3 | WorkLocation | Loc2, Loc3 | WorkLocation | All | ||
| EmpName | Count of Distinct EmpID | EmpName | Count of Distinct EmpID | EmpName | Count of Distinct EmpID | ||
| Emp2 | 1 | Emp2 | 2 | Emp1 | 2 | ||
| Emp3 | 1 | Emp3 | 2 | Emp3 | 1 | ||
| Others | 2 | Emp6 | 1 | Emp6 | 1 | ||
| Emp4 | 1 | Emp4 | 1 | ||||
| Others | 2 | Others | 2 |
4 Replies
- v-kelly-msft
Community Support
Hi Anonymous ,
Take Apr 2-2020 for example:
Location 2,Location 3,
Then you would see:
So the distinct EmpID should be:
EmpName Count of Distinct EmpID Emp2 1 Emp3 1 Others 2 It is different from your expected output,so I'm guessing whether I have misunderstood your point,pls correct me.
Best Regards,
KellyDid I answer your question? Mark my post as a solution!- AnonymousNot applicable
Hey Kelly,
Thanks for reaching out.
You have understood it correctly. I'll update the excepted o/p.
Primary problem statement is still to be achieved dynamically.
- v-kelly-msft
Community Support
Hi Anonymous ,
Sorry but I still not quite get your point.See below:
LogDate 2-Apr-2020 LogDate 4/1/2020,4/2/2020 LogDate 1-Apr-2020 WorkLocation Loc2, Loc3 WorkLocation Loc2, Loc3 WorkLocation All EmpName Count of Distinct EmpID EmpName Count of Distinct EmpID EmpName Count of Distinct EmpID Emp2 1--Why top1 is Emp2 Emp2 2 Emp1 2 Emp3 1 Emp3 2---I guess here should be 1?? Emp3 1 Others 2 Emp6 1 Emp6 1 Emp4 1 Emp4 1 Others 2 Others 2 Best Regards,
KellyDid I answer your question? Mark my post as a solution!- AnonymousNot applicable
Hey Kelly,
Here is the clarification:
Case 1: In case of tie (highest count), each EmpName is to be made visible. Remaining to be grouped as "Others"
So in example 1, the o/p shall change as below:
EmpName Count of Distinct Emp ID Emp1 1 Emp2 1 Emp3 1 Emp5 1 For example 2, the o/p is correct. There are 2 records each for date 1st and 2nd April 2020
EmpID EmpName WorkLocation LogDate 3 Emp3 Loc2 1-Apr-20 3 Emp3 Loc2 2-Apr-20 I hope this clarifies.
Thank you
Akash