Forum Discussion

DeepakPandeyPF's avatar
DeepakPandeyPF
Regular Visitor
2 years ago

Rank not Working

Hello All,

 

I am working on a requirement,

In this, I have created a filter of dimension from the parameter field,

 

 

and I want to make it dynamic and get the rank of sales through it,

 

Rank = 
IF(NOT(ISBLANK(Fact_Sales[Total Sale Qty])),RANKX(FILTER(ALL('KPI Selection'[KPI Selection Fields]),
NOT(ISBLANK(Fact_Sales[Total Sale Qty]))),Fact_Sales[Total Sale Qty],,DESC,Dense))

 

Top Sales Dynamically =
Var Rankvisible = IF(NOT(ISBLANK(Fact_Sales[Sales On Selection])),
RANKX(FILTER(ALL('KPI Selection'[KPI Selection Fields]),NOT(ISBLANK(Fact_Sales[Sales On Selection]))),Fact_Sales[Sales On Selection],,DESC,Dense))
Return
IF(Rankvisible <=TopTable[NVALUE],Fact_Sales[Sales On Selection])
 

 

 

but after doing everything, the issue is coming at one place where the rank is returning 1 for everyone.

 

If I select any value from 1 to 10 from the slicer then it should return the value accordingly.

 

I will Thankfull if you help me in this case

 

Thanks

5 Replies

  • Try the following : 

     

    Rank = 
    RANKX(
        ALL('KPI Selection'), 
        CALCULATE(SUM(Fact_Sales[Total Sale Qty])), 
        , 
        DESC, 
        DENSE
    )
  • Hi,

    Please share the intent.  I see that you are trying to write 2 measures - Rank and Top sales.  What is your ultimate goal?  Share the download link of t he PBI file and show the expected result.

    • DeepakPandeyPF's avatar
      DeepakPandeyPF
      Regular Visitor

      want that if I select any value from the dimensions and select any of the top numbers, then the value of the selected top cells should appear in the result as per the selected dimensions.