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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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