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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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