Forum Discussion

Sjoerd_g's avatar
Sjoerd_g
Frequent Visitor
4 years ago
Solved

Complex RANKX with multiple slicers/filters

Hi all,   I am stuck on a RANKX DAX formula and getting very strange results. There are multiple things at play that make the RANKX a bit complex. I created a sample file, but the database has more...
  • v-janeyg-msft's avatar
    v-janeyg-msft
    4 years ago

    Hi, Sjoerd_g 

     

    Your model is messy and so are the requirements, it's hard for me to give specific opinions.

    For your idea, the reference I can give is that you need to use summarize() in rank() function to customize a context you want, and then sort it. 

    If you don't want the line with response < 15 to appear on the visual, you can filter in the filter pane like this:

    Measure =
    RANKX (
        FILTER (
            SUMMARIZE (
                ALLSELECTED ( sample3 ),
                [Benchmarking],
                [company],
                "Responses", DISTINCTCOUNT ( sample3[response id] ),
                "NPSSOCRE", CALCULATE ( AVERAGE ( sample3[NPS Calc] ), sample3[nps_score] <> BLANK () )
            ),
            [Responses] > 15
        ),
        [NPS score],
        ,
        ,
        DENSE
    )
    

     

    Did I answer your question? Please mark my reply as solution. Thank you very much.
    If not, please feel free to ask me.

    Best Regards,
    Community Support Team _ Janey