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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors