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
nicolas_nsto
Frequent Visitor

RANKX FUNCTION IN A TABLE VISUAL

I have a data base of engine models sales. This data also contains specific technical characteristics about this products as power, rotations per minute (RPM), etc. 

 

I have applied a RANKX function to sort all models of products by the volum of sales as described below:

 
RANK = RANKX(ALL(M_Diesel[MODELO]), [QTDE TOTAL]),

 

Then, I created table visual with the columns "Model", "Sale volume" and "Ranking Order". Until this point, ok. However, I tried to insert other two columns of my query to show the technical characteristics for each model (power and RPM). As both of these datas are formatted as number type, I chose the option "Don't summarize" for these columns, so the values in the table would not appears as a sum calculation for each model, but as the exact power/rpm value of the respective product. The problem is when I applied this option, the rank column is no longer appropriately sorted, the position 1, 2 and 3 is reppeated for many models. 

nicolas_nsto_0-1677263469437.png

 

Do someone know how can I solve this?

Tks. 

 

2 ACCEPTED SOLUTIONS
lbendlin
Super User
Super User

it is now computing the rank of your model for the filter context of your added columns.  You need to change the RANKX measure to remove that filter context again, so that the computation stays on Model level.

View solution in original post

Padycosmos
Solution Sage
Solution Sage
4 REPLIES 4
nicolas_nsto
Frequent Visitor

Great, it was simpler than I thought! Thank you so much.

Padycosmos
Solution Sage
Solution Sage

I appreciate the video, it helped me, thanks!

lbendlin
Super User
Super User

it is now computing the rank of your model for the filter context of your added columns.  You need to change the RANKX measure to remove that filter context again, so that the computation stays on Model level.

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.