Forum Discussion

saud968's avatar
saud968
Icon for Memorable Member rankMemorable Member
3 years ago

Top 10 with Multiple Columns

I have multiple columns and I am trying to get the dynamic top 10 with NOC Completed Rate and FTR Percentage, however, while creating RANKX Dax is getting an error "special flag is not allowed as an argument". 

 

How do I get the TOP 10 with the columns mentioned above? 

@v-yangliu-msft, amitchandakAhmedx , Ashish_Mathur 

8 Replies

  • Hi,

    Try this measure

    Measure = calculate([FTR percentage],TOPN(5,all(TICKET_LIFECYCLE_FACT[FCD_FAMILYNAME]),[FTR percentage]),values(TICKET_LIFECYCLE_FACT[FCD_FAMILYNAME]))

    To the visual, drag FCD Family name and this meausre.

    • saud968's avatar
      saud968
      Icon for Memorable Member rankMemorable Member

      Below is the table looking after using your DAX also, I tried to combine the RANK for two columns RANK FTR and Rank NOC Completed with DAX - 

      Combined Rank = (TICKET_LIFECYCLE_FACT[Rank FTR] + TICKET_LIFECYCLE_FACT[Rank NOC Completed]) / 2



       

      • Ashish_Mathur's avatar
        Ashish_Mathur
        Icon for Super User rankSuper User

        How do you expect me to help you without having access to the PBI file?  Show the expected result there very clearly.

  • Hi, 
    Please follow a 5 steps process:

    1. Get the Rank of NOC Colum like this: 

    NOC_Rank =

        RANKX(

            ALL(TicketData),

            TicketData[NOC Completed Rate (Within 24 hours)],

            ,

            DESC,

            Dense

        )

    2. Get the rank of FTR column:

    FTR_Rank =

        RANKX(

            ALL(TicketData),

            TicketData[FTR Percentage],

            ,

            DESC,

            Dense

        )

    3. Combined the ranks: 

    Combined_Rank = [NOC_Rank] + [FTR_Rank]

    4. Get the final rank:

    Final_Rank =

        RANKX(

            ALL(TicketData),

            [Combined_Rank],

            ,

            ASC,

            Dense

        )

    5. Finally, you can get a new table as follows:

    Top10Table =

        FILTER(

            ALL(TicketData),

            [Final_Rank] <= 10

        )

     

    I hope this will solve your problem.

     







    • saud968's avatar
      saud968
      Icon for Memorable Member rankMemorable Member

      The filter one did not work rest all worked

    • saud968's avatar
      saud968
      Icon for Memorable Member rankMemorable Member

      I tried this but getting a blank value

      Top N by Family Name =
      var selected_top = SELECTEDVALUE(TICKET_LIFECYCLE_FACT[FCD_FAMILYNAME])
      var top_fam = SWITCH(selected_top, "Top 5" , IF([Rank FTR] <=5, [FTR PERCENTAGE]) )
      return top_fam
      not sure if the above is corrected