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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount 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
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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