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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
PPalkowski
Helper II
Helper II

Rank with Most From One and Least From Another

I am trying to get a way to rank for the most Reports with the Least Missing Data Here is my table

NameReportsMissing DataRankMostReportsRankLeastMissing
Bruce Wayne111112
Clark Kent69031
James Gordon892525
Wally West38051
Hal Jordan62543

So, I want my visual to show only Clark Kent , what would be the DAX for that measure?

 

3 REPLIES 3
Anonymous
Not applicable

This measure returns 1 if the rows should be visible and 0 if not.

[Should Show] =
var __onlyOneNameVisible = HASONEVALUE( T[Name] )
var __isNameColumnSelected = ISFILTERED( T[Name] )
var __shouldCalc =
	__onlyOneNameVisible
	&& __isNameColumnSelected
var __allVisibleNames = ALLSELECTED( T[Name] )
var __currentName = VALUES( T[Name] )
var __nameWithTheProperty =
	topn(1,
		filter(
			__allNames,
			[RankLeastMissing] = 1
		),
		[Reports],
		desc
	)
RETURN
	if( __sohuldCalc,
		1 * ( __nameWithTheProperty = __currentName )
	)

 

Best

D

Greg_Deckler
Community Champion
Community Champion

Perhaps:

 

Measure =
  VAR __Most = MAXX(ALL('Table'),[RankMostReports])
  VAR __Least = MINX(ALL('Table'),[RankLeastMissing])
RETURN
  IF(__Most = MAX([RankMostReports]) && __Least = MAX([RankLeastMissing),1,0)

  



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

This is the error I get

 

The MAX function only accepts a column reference as the argument number 1.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

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.