Forum Discussion
Issue with Rankx measure in Table
- 4 years ago
330SMG this is the measure for top 5 first names:
Top5 First Names = CALCULATE( [Total Orders], FILTER( VALUES(DimCustomer[FirstName]), IF(RANKX(ALL(DimCustomer[FirstName]),[Total Orders],,DESC)<=5,[Total Orders],BLANK()) ) )
After you created the measure you need to make sure to put the right column in the visual (In this case. [FirstName], in the previous case [CustomerKey]). That is why in both cases I get the right result with the same data you have.
330SMG I tested your measure on my sample data and it's working:
Also created a 2nd version, so you can try it, but if the 1st one didn't work then good chance this won't work neither:
1. Is [First Name] a unique key in your customer table?
2. Maybe you don't have a proper relatioship between dim customers and the fact?
So I changed it to the column that is the join between the tables Customer Key and same thing, it just shows the total in the visulization not the top 5.
Oh and I tried your TopN Dax, Same thing. My joins all apear correct, but obviously they art not. I am realitively new to BI and am really stumped by this. I need to understand the mechanism on why it is not creating individual entries. I have worked with SQL and Excel for a long time and I am a little lost on this error.
- SpartaBI4 years ago
Community Champion
330SMG can you maybe share the file? It's really hard to say what is broken without looking at it in this case.
P.S.
Check out my showcase report:
https://community.powerbi.com/t5/Data-Stories-Gallery/SpartaBI-Feat-Contoso-100K/td-p/2449543
Give it a thumbs up if you liked it 🙂- 330SMG4 years agoFrequent Visitor
Ok How do I share the file? I am really new to the world of BI.
That report is impressive.