Forum Discussion

Saxon10's avatar
Saxon10
Icon for Post Prodigy rankPost Prodigy
5 years ago
Solved

Frequency/most repeated value (Dax)

Hi, I have a two columns are id and status. I am trying to get the most frequency/repeated status based on the two columns.   Example:   Within DM3 has two different status Ok and Not ok and mos...
  • Fowmy's avatar
    Fowmy
    5 years ago

    Saxon10 

    Please try this code:

    Result = 
    VAR __id = [Id]
    VAR __t = 
        MAXX (
            TOPN (
                1,
                SUMMARIZE (
                    FILTER (Table6,Table6[Id] = __id && Table6[Status] <> BLANK() && Table6[Type] = "MWL" ),
                   Table6[Status],
                    "Count", COUNT (Table6[Status] )
                ),
                [Count]
            ),
           Table6[Status]
        )
    return
    
    IF( Table6[Status] = BLANK() || Table6[Type] <> "MWL" , BLANK() , __t )