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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
Anonymous
Not applicable

Help With rank

I have a table Containing columns like

 

CustomerID,    DeliveryStatus                   DateRegistered   etc....

1-123                  Late                       2010-01-01

1-123                   OK                        2014-01-01

1-123                   Late                       2015-01-01

20-2021               Late                       2011-12-01

 

What I want to do is create a messure for  rank  Customer based on existens of late delivery  (IE count of rows with late delivery)

 

I Tried something like 

 

= RANKX(ALLSELECTED(Table[CustomerID]); :CALCULATE(COUNTX(Table;Table[DeliveryStatus]);FILTER(Table;Table[DeliveryStatus]="Late"))   But   can't get it to work. What Have I missed.
1 ACCEPTED SOLUTION
v-lili6-msft
Community Support
Community Support

hi @Anonymous 

Just adjust the formula as below:

Rank = RANKX(ALLSELECTED('Table'[CustomerID]),CALCULATE(COUNT('Table'[DeliveryStatus]),'Table'[DeliveryStatus]="Late"))

Result:

1.JPG

 

Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-lili6-msft
Community Support
Community Support

hi @Anonymous 

Just adjust the formula as below:

Rank = RANKX(ALLSELECTED('Table'[CustomerID]),CALCULATE(COUNT('Table'[DeliveryStatus]),'Table'[DeliveryStatus]="Late"))

Result:

1.JPG

 

Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

I can't get it to work:

 

NoOfRowsWithLate = CALCULATE(COUNT(Table[DeliveryStatus]);Table[DeliveryStatus]="Late")

And

Rank = RANKX(ALLSELECTED('Table'[CustomerID);CALCULATE(COUNT(Table[DeliveryStatus]);OTDIN[DeliveryStatus]="Late"))

 

 

I get this:

Rank.png

hi, @Anonymous 

For rankx funtion, it usually involves row context in the visual.

If possible, please share a simple sample pbix file for us have a test, that will be great help.

 

Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

I see. It works correct as long as I don't add the "Customer Name"   that is in another table (that links on the customer id)

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.