Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hello!
I need help with my RANKX-function.
I have a facttable that looks like this:
And my RANKX looks like this:
I want to rank each date depending on OD
But when I create a table with the the Supplier Names instead of the supplierID, I get a table where each supplier is on each date, even though there is only one on each date in the facctable.
Why is this happening and what can I do about it?
Thank you very much for any replies
@Anonymous , Try measure like
Rankx(allselected(Table[date],Table[Supplier name]), [Distance from selected %])
If you take any column other one used in rank , then rank will be inside that column
For Rank Refer these links
https://radacad.com/how-to-use-rankx-in-dax-part-2-of-3-calculated-measures
The problem unfortunately remains. Each [Date] still gets every [SupplierName] even though every date only have one supplier and they are connected via a relationship through [SuppllierID].
@Anonymous It likely has something to do with your ranking measure. What is the formula for it? Also, this may help:
To *Bleep* with RANKX! - Microsoft Power BI Community
@Greg_Deckler
I think the problems lies with my dim- and my fact-table.
Because when I use 'Suppliers'[SupplierName] instead of 'PurchaseFacts'[SupplierID], every date on 'PurchaseFacts' get a row for each supplier.
Any Idea?
@Anonymous Hard to say with the information provided.
Sorry, having trouble following, can you post sample data as text and expected output?
Not really enough information to go on, please first check if your issue is a common issue listed here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882
Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.
@Greg_Deckler
I apoligize for not being clear enough. Will do my best to tackle this in the future. How do I upload my .pbix-file?
1. I have a file but I don't know how to share it.
2. The measure [Distance from OD %] gives a value to each date depending on a slicer, the code looks like this:
Distance from selected OD % =
DIVIDE(
ABS( MAX( PurchaseFacts[OD] ) - SELECTEDVALUE( 'OD Diameter'[OD Diameter] ) ),
MAX(PurchaseFacts[OD])
)This is just a measurement on how far away a date is from a selected value in a slicer.
I want to order these by how large they are.
Ranking OD Differance =
RANKX( ALL(PurchaseFacts[Date]), [Distance from selected OD %] ,, ASC )Nothing Strange this far. It looks like it should
But when I replace SupplierID with SupplerName this happens:
Every date get every supplier.
This is the relationship:
Why is this happening? How can I prevent this?
How Do I upload my pbix-file?
@Anonymous Upload your PBIX to OneDrive, Box or any file sharing site and then share a link. Easiest, quickest way.
@Greg_Deckler
https://drive.google.com/file/d/14KgNeBnTj0dmn7n7KXmZfAqSdpDL4thf/view?usp=sharing
Use this together with the schreenshots i provided before.
Thank you very much for helping me
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 97 | |
| 76 | |
| 52 | |
| 51 | |
| 46 |