Forum Discussion
Product ranking
- Anonymous2 years ago
Hi, MrMP
First, thanks for amitchandak help. If you have not solve the problem, you can try the following method.DAX:
Rank = RANKX ( FILTER ( 'Table', 'Table'[Date] = EARLIER ( 'Table'[Date] ) ), 'Table'[Sales], , DESC, Dense )MaxRank = VAR _maxRank = CALCULATE(MAX('Table'[Rank])) RETURN _maxRank RANK BY Product = IF ( CALCULATE ( SUM ( 'Table'[Rank] ) ) > [MaxRank], "Please select one Product", [MaxRank] )Best Regards,
Yang
Community Support TeamIf there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!How to get your questions answered quickly -- How to provide sample data in the Power BI Forum
MrMP , if you create a rank measure it will get distributed based on date in second visual and will give date of filtered product
rankx(allselected(Table[Product]), [Sales measure])
or new rank function
rank(DENSE,ALLSELECTED(Table[Product], Table[Date]),ORDERBY([Sales],DESC),, partitionBy(Table[Date]) )
Power BI - New DAX Function: RANK - How It Differs from RANKX: https://youtu.be/TjGkF44VtDo
Thank you for help. Bottom chart should be trend over time. With that measure, it gives rank 1 for every calendar date when I select product.