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])))
khappersett
Resolver I
9 years agoI 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.
khappersett
Resolver I
9 years agoI 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.