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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
JustinDoh1
Post Prodigy
Post Prodigy

Need some clarifications with TOPN & how to add more criteria

I have bottom DAX that illustrates TOPN:

JustinDoh1_0-1757979497760.png

My understanding with TOPN is that it returns the top row.

So, for this case, because we have same value for "MaxTotalWHSS", it would return 5 rows, instead of 1 row, correct?

 

How do I add more criteria so that it would be something like:

tblSurvey[MaxTotalWHSS] ASC and tblSurvey[ProcessingDate] ASC ? 

 

Thanks.

 

1 ACCEPTED SOLUTION
Praful_Potphode
Solution Sage
Solution Sage

Hi @JustinDoh1 ,

you can try below snippet.

Praful_Potphode_0-1758001890310.png

Table 2 = TOPN(1,
FILTER(
    ALL('Table'),
    'Table'[StartCutOff]>=0
),
'Table'[MaxTotalWHSS],ASC,'Table'[ProcessingDate],ASC)

View solution in original post

2 REPLIES 2
Praful_Potphode
Solution Sage
Solution Sage

Hi @JustinDoh1 ,

you can try below snippet.

Praful_Potphode_0-1758001890310.png

Table 2 = TOPN(1,
FILTER(
    ALL('Table'),
    'Table'[StartCutOff]>=0
),
'Table'[MaxTotalWHSS],ASC,'Table'[ProcessingDate],ASC)
lbendlin
Super User
Super User

You can specify multiple sort criteria for TOPN. TOPN function (DAX) - DAX | Microsoft Learn

 

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.