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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
russm
Helper I
Helper I

Calculating modes

What is the best way to calculate the mode (central tendency measure) from an unpivoted column of numerical data (e.g., Likert response values) in Power BI?

 

Thanks,

 

Russ

1 ACCEPTED SOLUTION
KHorseman
Community Champion
Community Champion

@russm perhaps the solution offered on this article.

 

Mode :=
MINX (
    TOPN (
        1,
        ADDCOLUMNS (
            VALUES ( Data[Value] ),
            "Frequency", CALCULATE ( COUNT ( Data[Value] ) )
        ),
        [Frequency],
        0
    ),
    Data[Value]
)




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

Proud to be a Super User!




View solution in original post

4 REPLIES 4
KHorseman
Community Champion
Community Champion

@russm perhaps the solution offered on this article.

 

Mode :=
MINX (
    TOPN (
        1,
        ADDCOLUMNS (
            VALUES ( Data[Value] ),
            "Frequency", CALCULATE ( COUNT ( Data[Value] ) )
        ),
        [Frequency],
        0
    ),
    Data[Value]
)




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

Proud to be a Super User!




Hi KHorseman, I am new to the Power BI Community forum and not sure if this is correct etiquette or not to reply to this post. Please let me know if not. I found this post in my search to calculate 'Mode'. But when I use the solution, I get an error "Function ADDCOLUMNS expects a column name as argument number 4."

christinek_0-1680053434765.png

Are you able to shed any light on where I have gone wrong please?

Anonymous
Not applicable

It worked

 

Thank you very much

Perfect!

Thank you!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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