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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
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.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.