Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
I have a table of clients and their genders, and I need to identify the gender with the most values, so from a table like this:
Client 1 - Male
Client 2 - Male
Client 3 - Female
Client 4 - Male
Client 5 - Male
Client 6 - Male
I need to produce the word "Male" as a measure, because there are 5 males and only 1 female. I can't use visual filters to achieve this.
Using RANK, I got Male = 1 and Female = 2, but I'm not sure how to take that output and produce the word "Male".
What is wrong with my approach? Thank you!
Solved! Go to Solution.
Hi @Anonymous
Please try
Max Gender =
MAXX (
TOPN (
1,
SUMMARIZE ( 'Table', 'Table'[Gender], "@Count", COUNTROWS ( 'Table' ) ),
[@Count]
),
'Table'[Gender]
)
Hi @Anonymous
Please try
Max Gender =
MAXX (
TOPN (
1,
SUMMARIZE ( 'Table', 'Table'[Gender], "@Count", COUNTROWS ( 'Table' ) ),
[@Count]
),
'Table'[Gender]
)
This worked great - I was able to even add a filter on to COUNTROWS to remove blanks from consideration. Thanks so much!
Didn't try the other option, that might work as well.
Hi,
Please check the below picture and the attached pbix file.
expected result measure: =
VAR _gendertablewithcounting =
ADDCOLUMNS (
DISTINCT ( Data[Gender] ),
"@count", CALCULATE ( COUNTROWS ( Data ) )
)
VAR _groupbymaxcounting =
GROUPBY (
_gendertablewithcounting,
Data[Gender],
"@maxcount", MAXX ( CURRENTGROUP (), [@count] )
)
RETURN
MAXX ( _groupbymaxcounting, Data[Gender] )
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
10 | |
10 | |
7 | |
6 | |
6 |
User | Count |
---|---|
17 | |
14 | |
11 | |
9 | |
7 |