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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
Anonymous
Not applicable

Ranking by value

I have a matrix with data on category and brand level. I have succeed to make a rank measure to be able to have the ranking on Brand level with a category. However my measure ranks the brands and category on alfabetical order, so if I want to rank the matrix by MAT Value, then the Ranking MAT measure for brands doesn't work, Other brands is nr 5 but the first in the list because of the value.

What I need is just a tweak of the measure, so I want to rank the whole matrix by MAT value and within that keep my ranking by brand within the category.

 

Mhrnjic_0-1671112110788.png

 

This is my measure which needs to be adjusted I think:

 

Ranking MAT =

VAR ProductsToRank = [Waarde van TopN]
VAR Ranking =
CALCULATE(
rankx( FILTER(allselected( 'Brand names'),'Brand names'[Brand]<>"Other brands"), [MAT Value]))
VAR IsotherSelected = SELECTEDVALUE('Brand names'[Brand]) = "Other brands"
VAR IsCategory = SELECTEDVALUE('Brand names'[Brand],"Category")
VAR Result =
IF(IsCategory="Category","",
IF(IsotherSelected, ProductsToRank,
IF ( Ranking <= ProductsToRank, Ranking, Ranking + 1) ))
Return
 Result

 

2 REPLIES 2
Anonymous
Not applicable

Hi @Anonymous ,

 

Do you expect the result to be an ordering of the red numbers below?

35.png

You need to group according to Dermatological Care in the RANKX function.

 

 

 

 

Best Regards,

Stephen Tao

 

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

 

Anonymous
Not applicable

Yes like the red numbers, but I have several categories following, so not just by Dermalogical care, but category by category.

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.