Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Help with TOP N Charts

Is there a way to have a Top N chart showing the top categories and then have 2 top n categories under showing the top subcategories for the two 2 categories showing in the top chart?  We have a slic...
  • v-kkf-msft's avatar
    4 years ago

    Hi Anonymous ,

     

    Suppose you have the following data. 

     

     

    Then for the category ranked 1 (FIN-Epro), use the [Sales] filter for the top 1 category to display the corresponding subcategories.

     

     

    Then for the category ranked 2 (FIN-ENCORE), use the measure [Rank] filter for the top 1 category to display the corresponding subcategories. 

     

    Rank = 
    VAR tab =
        SUMMARIZE (
            ALLSELECTED ( 'Table' ),
            'Table'[Categories],
            "s", SUM ( 'Table'[Sales] )
        )
    VAR RankCategory =
        COUNTROWS ( FILTER ( tab, [s] >= SUM ( 'Table'[Sales] ) ) )
    RETURN
        IF ( RankCategory = 2, 1 )

    If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
    Best Regards,
    Winniz
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.