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

Rankx function didn't work well when introduce a column from another table

I have a table visual that shows Rank columnName by countofReports

EalTim_0-1638367385578.png

 

RANKX(ALLSELECTED(Table[ColumnName]),CALCULATE([Count]))

This work fine but when I introduce another column Type from different table, it does work as shown below

EalTim_1-1638367500652.png

how do i fix this

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , measure rank is based on row context. So if add any other column than what you used in Rank, Rank it will readjust itself inside that additional column

 

so you need like

 

RANKX(ALL(Table[ColumnName], Table[Type]),CALCULATE([Count]))

or

RANKX(summarize(allselected(Table), Table[ColumnName], Table[Type]),CALCULATE([Count]))

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , measure rank is based on row context. So if add any other column than what you used in Rank, Rank it will readjust itself inside that additional column

 

so you need like

 

RANKX(ALL(Table[ColumnName], Table[Type]),CALCULATE([Count]))

or

RANKX(summarize(allselected(Table), Table[ColumnName], Table[Type]),CALCULATE([Count]))
Anonymous
Not applicable

I have tried the two measures and it is not working . it returns the same result as my rankx measure. 
I need it to rank only on Columname in the table visual. help please

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.