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
Anonymous
Not applicable

Ranking by measure

Hi,

I have a dataset which includes customer_number, kpi_nr and rate columns. What i want to do is creating new column or measure by ranking rate in each kpi_nr group. You can check the ranking column on the below screenshot for my purpose. I tried below measure but it gives 1 for each record on each kpi_nr group. 

count_ = RANKX(Query1,sum(Query1[rate]),,DESC)

ss.PNG
Thanks in advance.

1 ACCEPTED SOLUTION
isabella
Employee
Employee

Hi @Anonymous 

I did a local test ,you can take a referencehope will help you

Expression:Column = RANKX(FILTER('Table',[kpi_nr]=EARLIER('Table'[kpi_nr])),[rate])

 

isabella_0-1652344403142.png

 

 

 

 

Best Regards,

Community Support Team _Isabella

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
isabella
Employee
Employee

Hi @Anonymous 

I did a local test ,you can take a referencehope will help you

Expression:Column = RANKX(FILTER('Table',[kpi_nr]=EARLIER('Table'[kpi_nr])),[rate])

 

isabella_0-1652344403142.png

 

 

 

 

Best Regards,

Community Support Team _Isabella

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

danextian
Super User
Super User

Hi @Anonymous ,

Indicate in your measure which column you need to rank. Below is an actual measure I use in one of my visuals.

Rank By Description =
RANKX (
    ALLSELECTED ( Items[Description] ),
    [DynamicMeasure - PnL],
    ,
    DESC,
    SKIP
)

 

 

 As seen in the image below, items in Description are being ranked and the rank resets for every unique Hemisphere.

danextian_0-1652225909900.png

 










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


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

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.