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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
saudalomairi
Frequent Visitor

RANKX Based on a Text Measure Column

Salaam All,

 

Please if you don't mind helping on this, I have a case where i want to rank a text measure [Optimization PCP] where i can get the desire output as in [Optimization RANK].

 

The case is  I want to Rank [Optimization PCP], which is a measure, group by [Name] and [Year-Month].

 

Date,Year-Month,NAME,PCP Optimization,PCP Optimization Rank

2/1/2023 0:00Feb-2023AIncrease RPM1
2/2/2023 0:00Feb-2023AIncrease RPM2
2/3/2023 0:00Feb-2023ALower RPM1
2/4/2023 0:00Feb-2023AIncrease RPM3
2/5/2023 0:00Feb-2023AIncrease RPM4
2/6/2023 0:00Feb-2023AIncrease RPM5
2/7/2023 0:00Feb-2023AIncrease RPM6
2/8/2023 0:00Feb-2023AIncrease RPM7
2/9/2023 0:00Feb-2023ALower RPM2
2/10/2023 0:00Feb-2023ALower RPM3
2/11/2023 0:00Feb-2023AIncrease RPM8
2/12/2023 0:00Feb-2023ALower RPM4
2/13/2023 0:00Feb-2023AIncrease RPM9
2/1/2023 0:00Feb-2023BIncrease RPM1
2/2/2023 0:00Feb-2023BIncrease RPM2
2/3/2023 0:00Feb-2023BLower RPM1
2/4/2023 0:00Feb-2023BIncrease RPM3
2/5/2023 0:00Feb-2023BIncrease RPM4
2/6/2023 0:00Feb-2023BIncrease RPM5
2/7/2023 0:00Feb-2023BIncrease RPM6
2/8/2023 0:00Feb-2023BIncrease RPM7
2/9/2023 0:00Feb-2023BLower RPM2
2/10/2023 0:00Feb-2023BLower RPM3

 

Your help is highly appreciated.

Thanks and Regards

Saud

2 REPLIES 2
bhelou
Responsive Resident
Responsive Resident

Hi, Try this if it helps you : 
Optimization Rank =
RANKX(
FILTER(
ALL('YourTable'[Name], 'YourTable'[Year-Month]),
'YourTable'[Name] = MAX('YourTable'[Name]) && 'YourTable'[Year-Month] = MAX('YourTable'[Year-Month])
),
[Optimization PCP],, DESC, Dense
)

kindly accept as a solution if it works with you 



Thanks @bhelou ,

 

But it didn't work, all shows as 1

 

Regards

Saud

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors