Forum Discussion
Ranking on a dimension
Hi
I have data in this format, I want to show only Retail record if Retail and Wholesale is present. When there are more than one Businesses I want only Retail to be shown for that Category. There can be 5 levels of Businesses, if levels 1,2 are present show only 1.
if 2,3 only 2. so on and so forth
| Category | Prod | Business |
| Category1 | Prod1 | Retail |
| Category1 | Prod2 | Wholesale |
| Category1 | Prod 3 | Retail |
| Category2 | Prod3 | Retail |
| Category2 | Prod4 | Wholesale |
| Catagory3 | Prod5 | Wholesale |
This is how I want to show the data
| Category | Business |
| Category1 | Retail |
| Category2 | Retail |
| Category3 | Wholesale |
thanks for your help in advance
PBIfanatic , You need to create a column or measure rank and filter for 1
Column rank
rank = rankx(filter(Table, [Category] = earlier([Category]), [Prod],,asc,dense)
You can use some value and desc and filter for 1 in visual
refer these two
For Rank Refer these links
https://radacad.com/how-to-use-rankx-in-dax-part-2-of-3-calculated-measures
https://radacad.com/how-to-use-rankx-in-dax-part-1-of-3-calculated-columns
2 Replies
- amitchandak
Super User
PBIfanatic , You need to create a column or measure rank and filter for 1
Column rank
rank = rankx(filter(Table, [Category] = earlier([Category]), [Prod],,asc,dense)
You can use some value and desc and filter for 1 in visual
refer these two
For Rank Refer these links
https://radacad.com/how-to-use-rankx-in-dax-part-2-of-3-calculated-measures
https://radacad.com/how-to-use-rankx-in-dax-part-1-of-3-calculated-columns- PBIfanatic
Helper V
thanks amitchandak