Forum Discussion
RankX ranks stuff that does not exist
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:
- Anonymous5 years agoNot applicable
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?- Greg_Deckler5 years ago
Community Champion
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.- Anonymous5 years agoNot applicable
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?