Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago

RankX with 2 fields

Hello All.

 

For some reason 1 RankX formula works but the other doesnt.

 

Below is Dax:

 

Product Rank (Name) =

VAR CURRENTPRODUCT = MAX('(Dim) Product'[Product_Name])
RETURN
RANKX(FILTER(ALLSELECTED('(Dim) Product'),'(Dim) Product'[Product_Name] = CURRENTPRODUCT),[Master],,DESC,Dense)
 
Product Rank (Category) =

VAR CURRENTCATEGORY = MAX('(Dim) Product'[Category])
RETURN
RANKX(FILTER(ALLSELECTED('(Dim) Product'),'(Dim) Product'[Category] = CURRENTCATEGORY),[Master],,DESC,Dense)
 
 For some Reason the Name one works but the Cateogry doesnt, even though they are the both exact same DAX.
 
 
Can anyone help me fix this?

5 Replies