cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Responsive Resident

## 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, @amitchandak@Ahmedx , @Ashish_Mathur

8 REPLIES 8
Helper I

Hi,

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.

Responsive Resident

The filter one did not work rest all worked

Super User

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.

Regards,
Ashish Mathur
http://www.ashishmathur.com
Responsive Resident

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

Super User

Regards,
Ashish Mathur
http://www.ashishmathur.com
Responsive Resident

I appreciate your help I am not sure if I can share the PBX file, however, I will try to see if I can get a sample data and submit the same in PBX file

Responsive Resident

I was able to get Rank with

Rank NOC Completed = RANKX(ALL(TICKET_LIFECYCLE_FACT[FCD_FAMILYNAME]), [FTR PERCENTAGE],,DESC)

Responsive Resident

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]) )
not sure if the above is corrected