Forum Discussion
kiddknee
5 years agoNew Member
Sorting single value column 'descending' by latest week ending date
Problem: Table needs to be sorted 'descending' for column "3/30/21". Value is a Dax Measure and latest date changes each week. Can't seem to find how to do this in visual or through PQ ...
- Anonymous5 years ago
Hi kiddknee ,
Please try the following formula:
Rank = IF ( MAX ( 'Table'[Date] ) = MAXX ( ALL ( 'Table' ), [Date] ), RANKX ( FILTER ( ALL ( 'Table' ), 'Table'[Date] = MAX ( 'Table'[Date] ) ), CALCULATE ( [Your Measure] ), , ASC, DENSE ), 0 )Sort = IF ( HASONEVALUE ( 'Table'[Date] ) = FALSE (), MAXX ( FILTER ( 'Table', 'Table'[Agent Name] = MAX ( 'Table'[Agent Name] ) ), [Rank] ) )The final output is shown below:
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
selimovd
Most Valuable Professional
5 years agoHey kiddknee ,
you can choose in the settings of the visual if you want to sort by a specific column and if you want to sort ascending or descending:
If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
Best regards
Denis
Blog: WhatTheFact.bi