Forum Discussion

tgjones43's avatar
tgjones43
Helper IV
7 years ago
Solved

Count and rank values across multiple columns

Hi all   I have the following data and need a way to create the column at the end (in bold text):   Column 1 Column 2 Column 3 Column 4 Column 5 Column 6 Column 7 Column 8 Column 9 Co...
  • Zubair_Muhammad's avatar
    Zubair_Muhammad
    7 years ago

    tgjones43 

     

    Sorry I missed that point

     

    Here is the revised code

     

    Column =
    VAR temp1 = {
        [Column 1],
        [Column 2],
        [Column 3],
        [Column 4],
        [Column 5],
        [Column 6],
        [Column 7],
        [Column 8],
        [Column 9],
        [Column 10]
    }
    VAR temp2 =
        FILTER (
            ADDCOLUMNS (
                DISTINCT ( temp1 ),
                "MyCount", COUNTROWS ( FILTER ( temp1, [Value] = EARLIER ( [Value] ) ) )
            ),
            [MyCount] >= 3
        )
    RETURN
        CONCATENATEX ( temp2, [Value], ",", [MyCount], DESC )