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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.