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
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
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.