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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
ajay_gajree
Helper I
Helper I

TOPN Return One Value Only

Tries Highest Team = 
TOPN( 
    1, 
    ALL( 'Team Stats'[Team] ), [Total Tries] )

 

Hi All

 

I am using the above in the new Reference Label feature in the New Card Visual

When this returns more than one value, ie. there is a tie then the whole visual breaks, is there a way to amend the DAX above to just show one value?

2 ACCEPTED SOLUTIONS
sjoerdvn
Super User
Super User

Well, you will need a "Tie breaker"; so if you have multiple teams you could for instance take the first team by name:

 

Tries Highest Team = TOPN( 
    1, 
    ALL( 'Team Stats'[Team] )
    , [Total Tries],0
    ,'Team Stats'[team], 1
)

 

Alternatively, you could also show all teams tied for first place, comma sepperated;

Tries Highest Team = 
VAR tms = TOPN( 
    1, 
    ALL( 'Team Stats'[Team] )
    , [Total Tries]
)
RETURN CONCATENATEX(tms, [Team],",")

 

View solution in original post

Jihwan_Kim
Super User
Super User

Hi,

I am not sure how you want to show only one when there are two result that show top number, but please try something like below if it suits your requirement.

The second criteria to decide the rank in the below is the team-name ascending order.

 

INDEX function (DAX) - DAX | Microsoft Learn

 

 

 

Tries Highest Team = 
	INDEX(
		1,
		ALL('Team Stats'[Team]),
		ORDERBY(
			[Total Tries],
			DESC,
			'Team Stats'[Team],
			ASC
		)
	)

 

 



Microsoft MVP



If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.




LinkedInVisit my LinkedIn page




Outlook BookingSchedule a short Teams meeting to discuss your question



View solution in original post

3 REPLIES 3
bhanu_gautam
Super User
Super User

@Jihwan_Kim , Thanks for sharing this is really helpful




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






Jihwan_Kim
Super User
Super User

Hi,

I am not sure how you want to show only one when there are two result that show top number, but please try something like below if it suits your requirement.

The second criteria to decide the rank in the below is the team-name ascending order.

 

INDEX function (DAX) - DAX | Microsoft Learn

 

 

 

Tries Highest Team = 
	INDEX(
		1,
		ALL('Team Stats'[Team]),
		ORDERBY(
			[Total Tries],
			DESC,
			'Team Stats'[Team],
			ASC
		)
	)

 

 



Microsoft MVP



If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.




LinkedInVisit my LinkedIn page




Outlook BookingSchedule a short Teams meeting to discuss your question



sjoerdvn
Super User
Super User

Well, you will need a "Tie breaker"; so if you have multiple teams you could for instance take the first team by name:

 

Tries Highest Team = TOPN( 
    1, 
    ALL( 'Team Stats'[Team] )
    , [Total Tries],0
    ,'Team Stats'[team], 1
)

 

Alternatively, you could also show all teams tied for first place, comma sepperated;

Tries Highest Team = 
VAR tms = TOPN( 
    1, 
    ALL( 'Team Stats'[Team] )
    , [Total Tries]
)
RETURN CONCATENATEX(tms, [Team],",")

 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.