Forum Discussion
Index a measure
Hi all
I need to add a measure that returns me in descendent order an index.
This is the table that for sensitive matters I cut the data:
In the example above I am selecting one product which is produced in 6 plants (that's why it appeats 6 times above)
The correct result should be from 1 to 6 because they all have different demand.
The measure I created is the following:
Index =
RANKX(
ALLEXCEPT('SKU by line - Official',
'SKU by line - Official'[Country of Manufacturing],
'SKU by line - Official'[Manufacturing plant of production],
'SKU by line - Official'[Manufacturing line],
'SKU by line - Official'[Package material],
'SKU by line - Official'[Refilability],
'SKU by line - Official'[MS-SS],
'SKU by line - Official'[Volume],
'SKU by line - Official'[Category],
'SKU by line - Official'[Product name],
'SKU by line - Official'[Date]),
CALCULATE([Demand by bottler (Year +1)]),,
DESC,Dense)
How can I get it right?
Note: click on the image to see right resolution.
Thanks.
5 Replies
- AnonymousNot applicable
Hi o59393 ,
You can try the following dax:
Index = RANKX ( FILTER ( ALLSELECTED ( 'SKU by line - Official' ), 'SKU by line - Official'[Country of Manufacturing] = MAX ( 'SKU by line - Official'[Country of Manufacturing] ) && 'SKU by line - Official'[Manufacturing plant of production] = MAX ( 'SKU by line - Official'[Manufacturing plant of production] ) && 'SKU by line - Official'[Manufacturing line] = MAX ( 'SKU by line - Official'[Manufacturing line] ) && 'SKU by line - Official'[Package material] = MAX ( 'SKU by line - Official'[Package material] ) && 'SKU by line - Official'[Refilability] = MAX ( 'SKU by line - Official'[Refilability] ) && 'SKU by line - Official'[Volume] = MAX ( 'SKU by line - Official'[Volume] ) && 'SKU by line - Official'[Category] = MAX ( 'SKU by line - Official'[Category] ) && 'SKU by line - Official'[Product name] = MAX ( 'SKU by line - Official'[Product name] ) && 'SKU by line - Official'[Date] = MAX ( 'SKU by line - Official'[Date] ) ), CALCULATE ( [Demand by bottler (Year +1)] ), , DESC, DENSE )Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
- o59393
Post Prodigy
Hi Anonymous
It shows 1 for all the rows:
Thanks!
- AnonymousNot applicable
Hello,
Instead of using RankX, utilize the Rank function; it will effectively address your issue. When using the Rank function, make sure to include the entire table name as the argument( All[Table Name]). This approach will provide you with the accurate rank according to your specified criteria.
Best regards,
- o59393
Post Prodigy
Hi Anonymous
Nope, didnt work:
Regards.
- AnonymousNot applicable
Hi
Refer the below Link
https://www.youtube.com/watch?v=dK82cBUfwK4
https://www.youtube.com/watch?v=dK82cBUfwK4