DAX for calculating MODE function

Dear all,
Is there a DAX formula for calculating the MODE function?
If no, how can I write a DAX formula for this?

Thanks.

Hi @Khaiboon,

Welcome to the Forum.

Alberto Ferrari and Marco Russo have an article on statistical patterns in DAX which can be found here.

The mode is the value that appears most often in a set of data. This formula ignores blank values, which are not considered part of the population. The result is identical to the MODE and MODE.SNGL functions in Excel.

Mode =
MINX(
    TOPN(
        1,
        ADDCOLUMNS(
            VALUES( Table[Column] ),
            "@Freq", CALCULATE( COUNT( Table[Column] ) )
        ),
        [@Freq],
        0
    ),
    Table[Column]
)

I hope this is helpful

Hi Melissa,
Thanks so much for your reply.
I will check out the link and also try out the DAX you provided.
Cheers!

Hello @Khaiboon

Did the responses above help solve your query?

If not, can you let us know where you’re stuck and what additional assistance you need?

If it did, please mark the answer as the SOLUTION by clicking the three dots beside Reply and then tick the check box beside SOLUTION

Thank you

Yes, it works! Thanks !