Forum Discussion
khappersett
Resolver I
9 years agoRANKX Function to Rank Table by Revenue
I am having trouble getting my rankx function to work. I have visited so many threads with similar questions but still can't seem to figure it out. I have a table with product skus, item IDs, rev...
- 9 years ago
I got it working with this code:
Rank = rankx(ALLSELECTED('PH FY 2016'[sku]),CALCULATE(SUM('PH FY 2016'[Net Revenue]), ALLEXCEPT('PH FY 2016','PH FY 2016'[sku], 'Cat DICT'[Category])))
Vvelarde
Community Champion
9 years ago
If you are using a calculated Column:
Try with:
Ranking = RANKX(Table1;table1[Net Revenue];;DESC)
Regards
Victor
Lima - Peru
- khappersett9 years ago
Resolver I
I am getting this error: A single value for column 'Net Revenue' in table 'PH FY 2016' cannot be determined.
I used this code...
Rank = rankx('PH FY 2016','PH FY 2016'[Net Revenue],,DESC)The Net Revenue column is not calculated - it was on the Excel table that I imported into Power BI.
- khappersett9 years ago
Resolver I
I got it working with this code:
Rank = rankx(ALLSELECTED('PH FY 2016'[sku]),CALCULATE(SUM('PH FY 2016'[Net Revenue]), ALLEXCEPT('PH FY 2016','PH FY 2016'[sku], 'Cat DICT'[Category])))- v-chuncz-msft9 years ago
Community Support
Glad to hear that you've solved this problem. You could help mark it as answer. Your contribution is highly appreciated.