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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
johnmelbourne
Helper V
Helper V

Return the highest count of rows for a specific column value

I would like to return just the top row of this table, and the position. But am unsure of what methodlogy / function to use to get the result to return just the top row. 

Any assistance and explanation would be appreciated.

PBIX link: https://drive.google.com/file/d/1ORDN26jH406gaFc7tiFoHi83Ye7fBwhq/view?usp=share_link

 

result6.png

 

 

 

1 ACCEPTED SOLUTION
ValtteriN
Super User
Super User

Hi,

I recommend using a filter measure. E.g.

Data:

ValtteriN_0-1669452676731.png

Dax:

Filter the most rows =
 var _most = MAXX(ALL('Table (13)'),CALCULATE(COUNT('Table (13)'[Position]),ALL('Table (13)'[value]))) return

IF(countrows('table (13)')=_most,1,0)

First I calculate which position has the most rows then I use this in an if condition.


Now place this measure as a filter:
ValtteriN_0-1669453741625.png

I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!

My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/







Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

1 REPLY 1
ValtteriN
Super User
Super User

Hi,

I recommend using a filter measure. E.g.

Data:

ValtteriN_0-1669452676731.png

Dax:

Filter the most rows =
 var _most = MAXX(ALL('Table (13)'),CALCULATE(COUNT('Table (13)'[Position]),ALL('Table (13)'[value]))) return

IF(countrows('table (13)')=_most,1,0)

First I calculate which position has the most rows then I use this in an if condition.


Now place this measure as a filter:
ValtteriN_0-1669453741625.png

I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!

My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/







Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors