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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

How to calculate the % of the most common value in a column

Hi there,

 

I have a column called [result_value] that has multiple rows, for example, the most common row is "Art & Design" there are 12 rows with that specific value, I want a % calculated from that.

 

It looks quite simple but I haven't found a way to do it surprisingly. I want to see the total % of the top value in comparison to the rest of the entries, not just specifically "Art & Design", as there might be other values in future that surpass it.

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @Anonymous 
This should work in a cadr visual 

 

Most Common % =
VAR CountAll =
    COUNTROWS ( TableName )
VAR ValuesFrequency =
    ADDCOLUMNS (
        TableName,
        "@Frequency",
            COUNTROWS (
                CALCULATETABLE ( TableName, ALLEXCEPT ( TableName, TableName[result_value] ) )
            )
    )
VAR MaxFrequency =
    MAXX ( ValuesFrequency, [@Frequency] )
RETURN
    DIVIDE ( MaxFrequency, CountAll )

 

View solution in original post

5 REPLIES 5
tamerj1
Super User
Super User

Hi @Anonymous 
This should work in a cadr visual 

 

Most Common % =
VAR CountAll =
    COUNTROWS ( TableName )
VAR ValuesFrequency =
    ADDCOLUMNS (
        TableName,
        "@Frequency",
            COUNTROWS (
                CALCULATETABLE ( TableName, ALLEXCEPT ( TableName, TableName[result_value] ) )
            )
    )
VAR MaxFrequency =
    MAXX ( ValuesFrequency, [@Frequency] )
RETURN
    DIVIDE ( MaxFrequency, CountAll )

 

Anonymous
Not applicable

Hi @tamerj1 

Thanks for the response, I'm not sure why but I'm getting this error when I apply it 

KA95_0-1654441231612.png

 

@Anonymous 

The last part use CountAll not the table name

Anonymous
Not applicable

Apologies @tamerj1 I'm not sure why I did that... I must have read it wrong, anyway it works now greatly appreciate it. 

@Anonymous 
Please do not apologies. It was actually my mistake. Please accept my appology and thank you for marking my reply as acceptable solution.

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

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 community update carousel

Fabric Community Update - June 2025

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