Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
abanar
Helper II
Helper II

Comparing values in the same row and rank the columns' values

Dear All,

 

I have a data table which has the following values.

Row_NameCol_1Col_2Col_3Col_4Col_5Col_6Col_7Col_8Col_9Col_10
Row_12181843483566499595
Row_280145288302726265393
Row_348309415599965169341
Row_4141080158168721484
Row_57469956198853738482

 

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_NameRank_Col_1Rank_Col_2Rank_Col_3Rank_Col_4Rank_Col_5Rank_Col_6Rank_Col_7Rank_Col_8Rank_Col_9Rank_Col_10
Row_181096573411
Row_231052678841
Row_368210514937
Row_478362495101
Row_557281109634

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. 

2 REPLIES 2
amitchandak
Super User
Super User

@abanar , 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.

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.