Forum Discussion
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
hi Anonymous
Just adjust the formula as below:
Rank = RANKX(ALLSELECTED('Table'[CustomerID]),CALCULATE(COUNT('Table'[DeliveryStatus]),'Table'[DeliveryStatus]="Late"))Result:
Regards,
Lin
4 Replies
- v-lili6-msftCommunity Support
hi Anonymous
Just adjust the formula as below:
Rank = RANKX(ALLSELECTED('Table'[CustomerID]),CALCULATE(COUNT('Table'[DeliveryStatus]),'Table'[DeliveryStatus]="Late"))Result:
Regards,
Lin
- AnonymousNot 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:
- v-lili6-msftCommunity Support
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