Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Nas
New Member

Filter by Field

Hi, May I please ask if its possible to filter Top 5 by field. The field contains Dom Air, Reg Air , Int Air. I would like to filter top 5 routes by Trns used by Dom Air, Reg Air, Int Air in one visual. Not sure if possible 

 

5 REPLIES 5
Anonymous
Not applicable

Hi @Nas ,

Sorry to disturb you...

 

But did I answer your question ? Please mark my reply as solution. Thank you very much.
If not, please upload some insensitive data samples and expected output.

Best Regards,
Eyelyn Qin

Anonymous
Not applicable

Hi @Nas ,

It seems like the the  are in the same column and you want to calculate each category's Top5 value, right?

rankTop5 =
RANKX (
    FILTER ( ALL ( 'Table' ), 'Table'[Column1] = MAX ( 'Table'[Column1] ) ),
    CALCULATE ( MAX ( ( 'Table'[Value] ) ) ),
    ,
    DESC
)

9.18.fo.1.PNG

Did I answer your question ? Please mark my reply as solution. Thank you very much.

If not, please upload some insensitive data samples and expected output.

 

Best Regards,

Eyelyn Qin

 

Anonymous
Not applicable

 Hi @Nas ,

According to my understanding, you want to select top5 data based on three columns, right?

You could use the following formula:

rankColumn =
VAR a = [Dom Air]
VAR b = [Reg Air]
VAR t1 =
    FILTER ( ALL ( 'TopNTable' ), TopNTable[Dom Air] = a )
VAR t2 =
    FILTER (
        ALL ( 'TopNTable' ),
        TopNTable[Dom Air] = a
            && 'TopNTable'[Reg Air] = b
    )
RETURN
    RANKX (
        t1,
        RANKX ( t1, [Reg Air],, DESC, SKIP ) * 100
            + RANKX ( t2, [Int Air],, DESC, SKIP ) * 10,
        ,
        ASC,
        SKIP
    )

Then apply visual's filter : is less than or equal to 5 to visual :

9.18.1.1.PNG

Did I answer your question ? Please mark my reply as solution. Thank you very much.

If not, please upload some insensitive data samples and expected output.

 

Best Regards,

Eyelyn Qin

 

Hi @Eyelyn9

Thank you so much for your response.

Yes, top 5 data but based on one column. The column contains Dom Air, Reg Air, Int Air.

One Column

Dom Air Route Details 12

Route Details 11

Route Details 10

Route Details 9

Route Details 8

Int Air Route Details 12

Route Details 11

Route Details 10

Route Details 9

Route Details 8

Reg Air Route Details 12

Route Details 11

Route Details 10

Route Details 9

Route Details 8

Hope I am making sense

In

amitchandak
Super User
Super User

@Nas ,

In the visual level filter, you can use TOP N on the group by and Measure

 

You can create a Top N measure and that will filter if there is no other measure or use this a filter

example

Top 5 City Rank = CALCULATE([Sales],TOPN(5,all(Geography[City]),[Sales],DESC),VALUES(Geography[City Id]))

 

You can create rank and filter

City Rank = RANKX(all(Geography[City]),[Sales])

 

For Rank Refer these links
https://radacad.com/how-to-use-rankx-in-dax-part-2-of-3-calculated-measures
https://radacad.com/how-to-use-rankx-in-dax-part-1-of-3-calculated-columns
https://radacad.com/how-to-use-rankx-in-dax-part-3-of-3-the-finale
https://community.powerbi.com/t5/Community-Blog/Dynamic-TopN-made-easy-with-What-If-Parameter/ba-p/3...

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors