Forum Discussion
Rank by measure in Direct Query
I'm getting the same rank. I even tried ALL instead of ALLSELECTED and got the same results.
I tried a similar query on the Direct query on SQL server. and seem have worked
- nleuck6 years agoPost Patron
Below I have another example when trying to use RANKX. The left table works just fine, but as soon as I add description to the table it ranks everything as 1. I don't understand why.
Formula:
Rank by Product = RANKX(ALL('table1'[product_id]), CALCULATE(SUM('table1'[available_value])),, DESC, Skip)- amitchandak6 years agoSuper User
When we this category ranking, if we add any other group by, it tries to rank inside that. So as soon as you drag description the rank of product is the inside description, which is only 1.
For Rank Refer these links, if you can find a suitable option
https://radacad.com/how-to-use-rankx-in-dax-part-2-of-3-calculated-measures
https://radacad.com/how-to-use-rankx-in-dax-part-1-of-3-calculated-columns
https://radacad.com/how-to-use-rankx-in-dax-part-3-of-3-the-finale- nleuck6 years agoPost Patron
That seems like an error in the function. If I'm not referencing the description column in RANKX it shouldn't matter. The function should only use the product id becuase that's what I'm telling it to use in the formula. Just my thought.