Forum Discussion
josephheinrich
3 years agoRegular Visitor
Return TopN Column Names
Question:
How can I return the column names of the 3 columns with the highest sum? The three columns I'm expecting to be returned are 'Professional', 'Effective Communication', and 'Accurate Information'
Sample Data I'm working with:
| Date | Gathered Information | Built Rapport | Effective Communication | Accurate Information | Professional |
| 1/2/2023 | 0 | 0 | 1 | 1 | 1 |
| 2/2/2023 | 0 | 0 | 1 | 0 | 1 |
| 3/3/2023 | 0 | 0 | 1 | 0 | 1 |
| 4/3/2023 | 1 | 1 | 0 | 1 | 1 |
3 Replies
- Ashish_Mathur
Super User
- josephheinrichRegular Visitor
Thank you this did the trick! For anyone in the future, the data model needed to be adjusted. Unpivot Columns except for Date. Then create the following measure:
Measure = CONCATENATEX(TOPN(3,VALUES(Data[Attribute]),[Values],DESC),Data[Attribute],", ",[Values],DESC)- Ashish_Mathur
Super User
You are welcome.