Forum Discussion

readyraddy's avatar
readyraddy
Helper I
5 years ago
Solved

Chart for Top N + Others

My data has thousands of unique rows where each row has a category to it.

Example table:

 

DateOrder NoCategory
01/01/20201122Computer
01/02/20201133Table
14/02/20201143Sofa
14/03/20201155Computer

 

How do I show the top 1 (for example) with others.

So in this case, 
Top 1: Computer (2 no.)

Others: Others (2 no.)

  • Anonymous's avatar
    Anonymous
    5 years ago

    Hi readyraddy ,

     

    Check the following measures.

    Measure = CALCULATE(COUNT('Table'[Order No]),(ALLEXCEPT('Table','Table'[Category])))
    
    Measure 2 = RANKX(ALLSELECTED('Table'),[Measure],,DESC,Dense)
    
    Measure 3 = IF([Measure 2]=1,"top1","others")

    Result would be shown as below.

     

    Best Regards,

    jay

3 Replies

    • readyraddy's avatar
      readyraddy
      Helper I

      I've already watched the video but I think it won't be possible as there isnt any numerical value in the rows to rank the entire table.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi readyraddy ,

     

    Check the following measures.

    Measure = CALCULATE(COUNT('Table'[Order No]),(ALLEXCEPT('Table','Table'[Category])))
    
    Measure 2 = RANKX(ALLSELECTED('Table'),[Measure],,DESC,Dense)
    
    Measure 3 = IF([Measure 2]=1,"top1","others")

    Result would be shown as below.

     

    Best Regards,

    jay