Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Anessa
Frequent Visitor

Filter in chart: Show top N or show items when the value satisfies a condition (>=)

Please help to instruct on how to set up the line/bar chart with below conditions. Thanks for your support!

X: categories, Y: quantities.

Filter in chart: Show top 5 (X) with highest quantities (Y) OR show items (X) when the value (Y) satisfies a condition (>=). That means it should satify below cases:

  • Case 1:
    X with 5 categories or less. Chart shows all categories.
  • Case 2:
    X with 6 categories, all Y having quantities < 100. Chart shows the top 5 categories with highest quantities.
  • Case 3:
    X with 10 categories, all Y having quantities >= 100. Chart shows all 10 categories.
  • Case 4:
    X with 10 categories, 8 categories have quantities >= 100. Chart shows the 8 categories with quantities >=100.
1 ACCEPTED SOLUTION
v-denglli-msft
Community Support
Community Support

Hi @ Anessa,

 

Based on what you have described, I have created three tables.

They correspond to 5 categories, 6 categories and 10 categories.

vdengllimsft_0-1722933420944.pngvdengllimsft_3-1722933473212.pngvdengllimsft_4-1722933487666.png

 

Then create a page for each case and create corresponding bookmarks.

 

Case 1:

vdengllimsft_0-1722933553848.png

 

Case2: The top 5 categories are filtered by the filter /Top N/ option.

vdengllimsft_1-1722933572559.png

 

Case3&4:  Creates a measure MoreThan100 = if(SUM(Table_10_categories[Quantity])>=100,1,0)

                 This measure is then applied to the filter.

                 Set the filter to show items where MoreThan100 is equal to 1

vdengllimsft_2-1722933613508.png

 

This way, you can view the charts in different cases via bookmarks.

 

As for your reference to setting up 1 chart to satisfy all these cases.

This is not possible to achieve.


Best Regards,

Dengliang Li

 

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

View solution in original post

3 REPLIES 3
v-denglli-msft
Community Support
Community Support

Hi @ Anessa,

 

Based on what you have described, I have created three tables.

They correspond to 5 categories, 6 categories and 10 categories.

vdengllimsft_0-1722933420944.pngvdengllimsft_3-1722933473212.pngvdengllimsft_4-1722933487666.png

 

Then create a page for each case and create corresponding bookmarks.

 

Case 1:

vdengllimsft_0-1722933553848.png

 

Case2: The top 5 categories are filtered by the filter /Top N/ option.

vdengllimsft_1-1722933572559.png

 

Case3&4:  Creates a measure MoreThan100 = if(SUM(Table_10_categories[Quantity])>=100,1,0)

                 This measure is then applied to the filter.

                 Set the filter to show items where MoreThan100 is equal to 1

vdengllimsft_2-1722933613508.png

 

This way, you can view the charts in different cases via bookmarks.

 

As for your reference to setting up 1 chart to satisfy all these cases.

This is not possible to achieve.


Best Regards,

Dengliang Li

 

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

bhanu_gautam
Super User
Super User

@Anessa , For

  • Case 1:
    X with 5 categories or less. Chart shows all categories. :- No additional filtering is needed. The chart will automatically display all categories.
  • Case 2:
    X with 6 categories, all Y having quantities < 100. Chart shows the top 5 categories with highest quantities.:- Create a measure 
  • RankCategories = RANKX(ALL('Table'[Category]), CALCULATE(SUM('Table'[Quantity])), , DESC, Dense)
  • Add a visual-level filter to show only the top 5 categories:
    Drag the RankCategories measure to the Filters pane.
    Set the filter to show items where RankCategories is less than or equal to 5.
  • Case 3:
    X with 10 categories, all Y having quantities >= 100. Chart shows all 10 categories.
  • Create a measure FilteredCategories = IF(SUM('Table'[Quantity]) >= 100, 1, 0)
  • Add a visual-level filter to show only categories where FilteredCategories is 1:
    Drag the FilteredCategories measure to the Filters pane.
    Set the filter to show items where FilteredCategories is equal to 1.
  • Case 4:
    X with 10 categories, 8 categories have quantities >= 100. Chart shows the 8 categories with quantities >=100.
  • Use the same FilteredCategories measure from Case 3.
    Add a visual-level filter to show only categories where FilteredCategories is 1:
    Drag the FilteredCategories measure to the Filters pane.
    Set the filter to show items where FilteredCategories is equal to 1.



Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






@bhanu_gautam thanks for your quick response, actually what I need is how to set up 1 chart to: show top 5 (X) with highest quantities (Y) OR show items (X) when the value (Y) satisfies a condition. The cases are the demonstrations of how that 1 chart should function. Your reply divides it by cases (eventually 4 charts) so it misses the point. Do you have any way to set up 1 chart satisfying all those cases? 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.