RANKX Confusion in Implicit Hierarchy

I want to rank sales by value, at a Product level. This is working just fine, but when I add in the Product Subcategory, suddenly the ranks are all 1. For example:

This is all great. But if I add Subcategory…

Which is not what I wanted! As you can see I am using Contoso but my real life data is the same structure. I have attached the pbix. If someone could point out the error of my ways I would be most grateful! Thank you.

Contoso - Rank Question.pbix (4.4 MB)

@Jamie,

Give this a go:

Sales Value Rank = 
RANKX(ALLSELECTED(dimProductHierarchy[ProductSubCategoryName],dimProductHierarchy[ProductName]),
    [Total Sales]
    ,,DESC)

image

Just needed to fix the context and take out the unnecessary CALCULATE.

I hope this is helpful.

– Brian

Brilliant, thank you!

@Jamie,

:+1:- Glad to help.

  • Brian