Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago

Rankx with a column

Hi,

I do have a scenerio where i have a fact table with different keys which belongs to different dimensions along with stages and code des as two different columns .

I have a KPI where i want to apply the rank column as a filter so that it will show the top 1 or top 2 according to the filter applied usimg the calulated rank column which is yet to be created .

I was able to achieve it using a measure but i need it as a calculated column 

RANKX(ALLSELECTED(_Data[RelatedWithdrawlCode]),CALCULATE(SUM(Data[Withdrawal_Cnt])),,DESC)

I tried this but didn't work

RANKX (
VALUES (Data[RelatedWithdrawlCode] ),
CALCULATE (
sum ( Data[Withdrawal_Cnt] ),
ALLEXCEPT (Data,Data[RelatedWithdrawlCode] )
),
,
desc,
Dense
)

I wanted to have two ranks column one for the Stages and one for the codes 

There are additional slicers as well on top of the page like month_Year,Prod_code which will also be applied so that it will return accordingly

Please help me create this column as i am struggling and stuck in this scenerio.

Regards
Prabin Nepak 

4 Replies