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

RankX Excluding Blanks

Hi,

 

I have the code below which is working. However how I can I add something so the rank ignores blanks?

 

"

Solved/Closed Ticket Ranking =
VAR Currentmonth = 'Summary Table'[MonthYear]
VAR Currentteam = 'Summary Table'[Team]
VAR newtable = filter('Summary Table','Summary Table'[MonthYear]=Currentmonth && 'Summary Table'[Team] = Currentteam)

RETURN

rankx(newtable,'Summary Table'[Numer of Solved/Closed Tickets],,DESC,Dense)"
 
Thanks,
 
Stu
1 ACCEPTED SOLUTION

Hi,

 

It was ranking on the number of tickets.

 

I added the following and it seems to have worked also.

"

Solved/Closed Ticket Ranking =
VAR Currentmonth = 'Summary Table'[MonthYear]
VAR Currentteam = 'Summary Table'[Team]
VAR newtable = filter('Summary Table','Summary Table'[MonthYear]=Currentmonth && 'Summary Table'[Team] = Currentteam)

RETURN
if(not isBLANK('Summary Table'[Numer of Solved/Closed Tickets]),
rankx(newtable,'Summary Table'[Numer of Solved/Closed Tickets],,DESC,Dense))"
 
Thanks,

View solution in original post

3 REPLIES 3
AilleryO
Memorable Member
Memorable Member

Hi,

 

Depends on the column where you want to skip the BLANKS but you can add a condition to your VAR newtable :

newtable  = filter('Summary Table','Summary Table'[MonthYear]=Currentmonth && 'Summary Table'[Team] = Currentteam)&&NOT( ISBLANK( YourColumn ) ) )

 

Hope it helps

Hi,

 

It was ranking on the number of tickets.

 

I added the following and it seems to have worked also.

"

Solved/Closed Ticket Ranking =
VAR Currentmonth = 'Summary Table'[MonthYear]
VAR Currentteam = 'Summary Table'[Team]
VAR newtable = filter('Summary Table','Summary Table'[MonthYear]=Currentmonth && 'Summary Table'[Team] = Currentteam)

RETURN
if(not isBLANK('Summary Table'[Numer of Solved/Closed Tickets]),
rankx(newtable,'Summary Table'[Numer of Solved/Closed Tickets],,DESC,Dense))"
 
Thanks,

Good to know, and please don't forget to mark as solved for other members 🙂

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.