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

Ranking a column based on another column value

Hi,

 

I'm currently working on a dataset where I would need to display the location with the most ratings that are less than 3.

I can't seem to figure out the correct DAX functions to use to display this.

 

I have attached table below, any help would be greatly appreciated

 

Location nameRating
London5
Birmingham4
Coventry3
Basingstoke4
Manchester5
London5
Birmingham1
Coventry1
London2
Birmingham2
Coventry2
Birmingham2
Coventry3
Basingstoke4
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@OsmanEmi , Try measures like

 

cnt = calculate(count(Table[Location name] ), filter(Table, Table[Rating]<=3))

// This will give the location
Top 1 Rank = CALCULATE(max(Table[Location name]),TOPN(1,all(Table[Location name]),[cnt],DESC),VALUES(Table[Location name]))

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@OsmanEmi , Try measures like

 

cnt = calculate(count(Table[Location name] ), filter(Table, Table[Rating]<=3))

// This will give the location
Top 1 Rank = CALCULATE(max(Table[Location name]),TOPN(1,all(Table[Location name]),[cnt],DESC),VALUES(Table[Location name]))

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.