Forum Discussion
erhan_79
5 years agoPost Prodigy
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 : ...
PhilipTreacy
5 years agoSuper 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
Result
Regards
Phil
erhan_79
5 years agoPost 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
- ryan_mayu5 years agoSuper User
here is a workaround for you
Rank = RANKX(all('Table'),VALUE('Table'[Order Qty]),,ASC)+RANKX(all('Table'),VALUE('Table'[Order Number]),,ASC)/10 rank2 = RANKX('Table',VALUE('Table'[Rank]),,ASC)