The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Dear All,
I have a data table which has the following values.
Row_Name | Col_1 | Col_2 | Col_3 | Col_4 | Col_5 | Col_6 | Col_7 | Col_8 | Col_9 | Col_10 |
Row_1 | 21 | 8 | 18 | 43 | 48 | 35 | 66 | 49 | 95 | 95 |
Row_2 | 80 | 14 | 52 | 88 | 30 | 27 | 26 | 26 | 53 | 93 |
Row_3 | 48 | 30 | 94 | 15 | 59 | 99 | 65 | 16 | 93 | 41 |
Row_4 | 14 | 10 | 80 | 15 | 81 | 68 | 7 | 21 | 4 | 84 |
Row_5 | 74 | 69 | 95 | 61 | 98 | 8 | 53 | 73 | 84 | 82 |
What I need that rank the columns' values in every row compare to the column values and give back them rank in the selected row.
Based on the previous table data I give an solution example:
Row_Name | Rank_Col_1 | Rank_Col_2 | Rank_Col_3 | Rank_Col_4 | Rank_Col_5 | Rank_Col_6 | Rank_Col_7 | Rank_Col_8 | Rank_Col_9 | Rank_Col_10 |
Row_1 | 8 | 10 | 9 | 6 | 5 | 7 | 3 | 4 | 1 | 1 |
Row_2 | 3 | 10 | 5 | 2 | 6 | 7 | 8 | 8 | 4 | 1 |
Row_3 | 6 | 8 | 2 | 10 | 5 | 1 | 4 | 9 | 3 | 7 |
Row_4 | 7 | 8 | 3 | 6 | 2 | 4 | 9 | 5 | 10 | 1 |
Row_5 | 5 | 7 | 2 | 8 | 1 | 10 | 9 | 6 | 3 | 4 |
Can you help me to prepare a measure or a calculated table or column which can help me to get back the same result?
Thank you in advance.
@Anonymous , Unpivot all the column in power query , Rename the column with column name as Column_name and use that in Matrix visual in column field.
and then create a Rank column
Rank = rankx(filter(Table, Table[Row_Name] = earlier([Row_Name])), [Column_name])
Column Rank: https://www.youtube.com/watch?v=wDS_Vi4r9I4&list=PLPaNVDMhUXGaaqV92SBD5X2hk3TMNlHhb&index=39
Thank you for the advice. Actually my real usecase isn't so simple like the example I added here so I have a "virtual" table only in measure (not a calculated table) so the unpivot method isn't an option rightnow.
User | Count |
---|---|
77 | |
76 | |
36 | |
31 | |
29 |
User | Count |
---|---|
93 | |
81 | |
57 | |
48 | |
48 |