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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
LucasFERR
New Member

RANKX Power BI - Repeating

Hi, i'm having some trouble using HANKX, i'm trying to rank a table based on a column, This column is a sum between as points and RAND()*0.01, so i don't have any repeated value.

this is the formula im using:

 

ranking = RANKX(fto_resultados,fto_resultados[Pont+rand])

 

When i insert this measure in a table, it just return the the number one and repeat for every line.

Also tried using ALL an ALLSELECTED but did't worked as well

1 ACCEPTED SOLUTION

Hi Lucas:

Here are two measures that can work for one column and second one considering two columns from the same table: I will picture the table below. One or both of these should work. My table named used is 'TableRank'. I hope this provides your solution!

Rank EQ = RANK.EQ(TableRank[Stock],TableRank[Stock],DESC)
Part RankX = RANKX(FILTER(all(TableRank),
TableRank[Store]=EARLIER(TableRank[Store])),TableRank[Stock])
Whitewater100_0-1649098997422.png

 

 

View solution in original post

3 REPLIES 3
Whitewater100
Solution Sage
Solution Sage

Hi:

Can you try using a pattern such as: (Here is an example for ranking customers by net sales). Where Sales_Data is the Fact Table and Customers is Dimension table and Customers[Serach Name] is being ranked for net sales. I can't see your other tables,so I hope this helps!

Rank_Cust by Region =

IF([Net Sales] > 0,

RANKX(

    CALCULATETABLE(

          SUMMARIZE(Sales_Data, 

          Customers[Search Name]),

          ALL(Customers[Search Name])

    ),

  [Net Sales],

             ,

             DESC

))

I tried to do something like you did, but i stil getting the same result, in my case, both columns that i whant to analize are in the same table, is it supose to work difrently?

Hi Lucas:

Here are two measures that can work for one column and second one considering two columns from the same table: I will picture the table below. One or both of these should work. My table named used is 'TableRank'. I hope this provides your solution!

Rank EQ = RANK.EQ(TableRank[Stock],TableRank[Stock],DESC)
Part RankX = RANKX(FILTER(all(TableRank),
TableRank[Store]=EARLIER(TableRank[Store])),TableRank[Stock])
Whitewater100_0-1649098997422.png

 

 

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.