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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

July 2024 Power BI Update

Power BI Monthly Update - July 2024

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

July Newsletter

Fabric Community Update - July 2024

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