Forum Discussion
Need Help About Index
Hi there ;
I need your support about to fix my below index formula , let me explain what the problem :
I have a table which includes "order number" and "order qty ",as below :
and i have a index column DAX formula as below to give the order index number :
please try this
rank = RANKX('Table',CALCULATE(SUM('Table'[Order Qty]),ALLEXCEPT('Table','Table'[Order Number])),,ASC,Dense) +RANKX('Table',VALUE('Table'[Order Number]),,ASC,Dense)/10 rank2 = RANKX('Table',VALUE('Table'[rank]),,ASC,Dense)
10 Replies
- PhilipTreacySuper User
Hi erhan_79
Download this PBIX file with the following data and code
Create a Calculated Column with this code
Ranking = VAR MaxOrder = MAX ( 'Table'[Order Number] ) VAR Result = RANKX ( ALL ( 'Table' ), 'Table'[Order Qty] * MaxOrder + 'Table'[Order Number],,ASC ) RETURN ResultRegards
Phil
- erhan_79Post Prodigy
Dear PhilipTreacy ;
thanks for your reply but sometimes orders can have different order quantities at the same time .Your formula for this situation gives error for index.You can see below , just i added some line for each orders , when the order numbers repeats index is not working properly , it is indexing all the lines , it is not grouping by order number
For this situation , i expcect like that :
Could you pls check it for me
thanks for your kşnd supports
- PhilipTreacySuper User
Hi erhan_79
That's not the same thing as you first asked for. You should always supply a proper representation of your data at the start. I'll look into the problem.
Regards
Phil
- erhan_79Post Prodigy
You are right PhilipTreacy ;
i am sorry it was my fault , i forgot to explain all the scenarious , thank you very much for your kind supports dear .
i will wait for your good news
thanks
erhan