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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
devesqdeves
Helper II
Helper II

Rankx + Rand() not working

Hello , i am new  to the community and kinda new to power bi .

I am trying to rank a column(client) based on a measure that i created ( hc fac value) , and to that measure i added rand(hc fac value rand) , to not have any equal values, but the rank is showing as if it exists equal values , i am really struggling..

Can someone help me out please?

devesqdeves_0-1600166936188.png

 

1 ACCEPTED SOLUTION

Hi @devesqdeves ,

 

I assume that you have an ID for each of your client if not please create one with the client number (must be unique values) then add the following measure:

Rank_Without_Duplicates =
IF (
    HASONEVALUE ( Client[Cliente] )
        && [HC FAC Value] > 0;
    RANKX (
        ALL ( Client[Cliente] );
         (
            CALCULATE ( [HC FAC Value] )
                + INT ( CALCULATE ( MIN ( Client[Client ID] ) ) ) / 100000
        )
    )
)

 

Check result attach.

 

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

5 REPLIES 5
amitchandak
Super User
Super User

@devesqdeves , You have to add Rand() in Rank (Measure Rank)

 

Rank(Table,formula) +rank()/1000

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Thanks for the input ! But it is not working yet :c

@amitchandak 

@MFelix 

it shows like this

 

my rank measure =

IF (
HASONEVALUE ( Client[Cliente] ) && [HC FAC Value]>0,
RANKX(All(Client[Cliente]),[HC FAC Value],,DESC) + RAND()/1000)
 
already tried with dense and skip and still not working :s
 
it should be 1,2,3,4,5,6,7,8,9 etc , but its still repeating, i dont know what to do , need heelp plz
 

devesqdeves_0-1600168510653.png

 

Hi @devesqdeves ,

 

I assume that you have an ID for each of your client if not please create one with the client number (must be unique values) then add the following measure:

Rank_Without_Duplicates =
IF (
    HASONEVALUE ( Client[Cliente] )
        && [HC FAC Value] > 0;
    RANKX (
        ALL ( Client[Cliente] );
         (
            CALCULATE ( [HC FAC Value] )
                + INT ( CALCULATE ( MIN ( Client[Client ID] ) ) ) / 100000
        )
    )
)

 

Check result attach.

 

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



It worked !! Thanks !!

Hi @devesqdeves ,

 

Don't forget to mark the correct answer to help others.


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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