Forum Discussion
Rankx return empty value
Hi,
I have a matrix where I want to return the rank of my customer by total sales for a specific period.
I put this DAX
Hi vbourbeau ,
Maybe you could refer to below link about rank with hierarchy:
https://dataninjago.com/2017/12/11/dax-ranking-with-hierarchy-drill-down/
Regards,
Daniel He
15 Replies
- mussaendaCommunity Champion
Maybe you can filter the blank in Filters Pane where mTotal Sales is not blank.
- vbourbeauResolver II
I realize that my date measure are on another table that InvcDtl. It's the reason why the rank took all my customer. But my date table are linked with my InvcDtl table? Why the Date filter won't apply?
- vbourbeauResolver II
Ok I do a example see the attachment.
the result give that
ClienD and ClientE don't have any sales in 2016 but the table show them?
If I remove my Rank measure the filter work ok.
I don't know how to add my pbix so I create a link. https://we.tl/t-f0OQ4nhFOm
- v-danhe-msftMicrosoft Employee
Hi vbourbeau ,
Based on my test, you could refer to below formula:
Rank = IF(CALCULATE(SUM(Line[amount]))=BLANK(),BLANK(),rankx(ALLSELECTED(Line[Client]),CALCULATE(SUM(Line[amount]))))
Result:
Regards,
Daniel He
- v-danhe-msftMicrosoft Employee
Hi vbourbeau ,
Could you please post some simple sample data and your desired result to have a test if possible? 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
Regards,
Daniel He
- mussaendaCommunity Champion
- vbourbeauResolver II
Thank you
Do you know if it's my dax the problem, because if the date are in the same table as the invoice the problem don't occure? kind of relationship with both table?
- vbourbeauResolver II
Hi,
With my true data when I apply the filter the matrix give me this error:
there's not enough memory to complete this operation
I restart my computer and nothing.
Without the filter the matrix run in a sec.
- vbourbeauResolver II
Look If I add a line in my matrix the rank lost is mind? See the pbix
link to te file https://we.tl/t-0gcXo9Adwq