Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Top # on a new Table based on Count

I searched but I couldnt find an answer, new to Power BI of course. Any help is highly appreciated.   I have a table with calls based on languages. I am creating a new table with total count like t...
  • Icey's avatar
    6 years ago

    Hi Anonymous ,

    Try this:

    Lan Count = 
    TOPN (
        10,
        ADDCOLUMNS (
            SUMMARIZE ( Calls, Calls[Language] ),
            "Count", CALCULATE ( COUNTA ( Calls[Language] ) + 0, Calls[Checked] = "True" )
        ),
        CALCULATE ( COUNTA ( Calls[Language] ) + 0, Calls[Checked] = "True" )
            + RANKX ( Calls, Calls[Language],, DESC, DENSE ) / 10000
    )

     

    For TOPN, we should pay attention to this:

    If there is a tie, in order_by values, at the N-th row of the table, then all tied rows are returned. Then, when there are ties at the N-th row the function might return more than n rows.

     

     

    Best Regards,

    Icey

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.