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
johnmelbourne
Helper V
Helper V

Ignore Rank 1 results with blanks when ASC

Hi

So I have a rankx formula and a previousquarter function, and it is producing logical results depending on the sort order, but not what I want. Ha! 

 

It works fine when DESC, but treats a blank in the previous quarter as ranked 1 (but inserts a blank as that is what I have coded, when ASC and starts the previous quarter ranking at 2 for the others.

 

I want the PQ Rank not to include the blank. and for customers S T and U to be ranked #1 in the previous quarter (as they actually were #1 in the previous quarter, until customer A came along in the latest quarter).

 

Any assistance to ignore the PQ ranking for Customer A and start at 1 would be greatly appreciated.

 

Customer A had no data previous quarter, and when the rank is sorted DESC the results are like this.

 

CustomerKPI valueKPI RankPQ KPI rankRank change
H574+3
G10330
843+1
2113-2
573+4
C1032+1
B1621+1
A57  

 

and when the rank is sorted ASC I get these results.

 

CustomerKPI valueKPI RankPQ KPI rankRank change
Y223-1
X223-1
W3330
V3330
U112-1
T112-1
S112-1
A55  

 

 

But what I want is

 

CustomerKPI valueKPI RankPQ KPI rankRank change
Y2220
X2220
W3320
V332+1
U1110
T1110
S1110
A55  


I am using 

KPI Rank = 

IF(
ISBLANK([Average KPI value]),
BLANK(),
RANKX(
ALLSELECTED(Customers[Customer]
),
[Average KPI value],,ASC,Dense)

PQ KPI rank =
CALCULATE(
[Rank],
PREVIOUSQUARTER('Calendar'[Date])
)


Any assistance much appreciated.

Regards
John
 
1 ACCEPTED SOLUTION
3 REPLIES 3
harshnathani
Community Champion
Community Champion

Hi @johnmelbourne ,

 

Have a look at this video.

 

Some ways how to avoid ranking BLANKS().

 

https://www.youtube.com/watch?v=z2qzJVeYhTY

 

 

Regards,

Harsh Nathani

Appreciate with a Kudos!! (Click the Thumbs Up Button)

Did I answer your question? Mark my post as a solution!

Many thanks @amitchandak , I will review with interest.
Believe or not, I did try and find similar posts first.

I am sure these will be helpful.

Regards

John

 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors
Top Kudoed Authors