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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Shailu198
Helper I
Helper I

Showing only Bottom N values in chart

Hi All,

 

I want to show bottom 5 values based on count. Let me clarify more:

 

There are two columns - product_id & product. I want to show bottom 5 products based on count(product_id). Means which the product appears very less time in the column should be 1st & so on. But the problem is i have 22 products where the count is 1 and when i am doing bottom N filtering, all 22 products are appearing (since all have same value). I want only 5 out of those 22.

Any help would be appreciated.

 

 

Regards,

Shailesh

 

 

1 ACCEPTED SOLUTION
DoubleJ
Solution Supplier
Solution Supplier

Hi 

 

The following might be a solution. If I got you right, a product can be multiple times in your table. 

 

 

1. Create A Measure "ProductsCount"

ProductsCount = COUNTROWS(Products) 

 

2. The question now is: Which 5 of the 22 products shall be displayed? I created a column "SortValue" that takes the ProductId in account. Multiplying the "ProductsCount" measure by 1000000 and then adding the ProductID gives each Product a unique "SortValue". Of course this approach only works if the ProductID is an integer value.

SortValue = [ProductsCount]*100000 + Products[ProductId] 

3. You can now create a visual with the  Bottom 5 filter set on "SortValue"
TopN_02.PNGTopN_03.PNG


Of course the formula for the "SortValue" formula depends on your actual data. 

 

I hope this helps!

JJ

 

 

View solution in original post

3 REPLIES 3
DoubleJ
Solution Supplier
Solution Supplier

Hi 

 

The following might be a solution. If I got you right, a product can be multiple times in your table. 

 

 

1. Create A Measure "ProductsCount"

ProductsCount = COUNTROWS(Products) 

 

2. The question now is: Which 5 of the 22 products shall be displayed? I created a column "SortValue" that takes the ProductId in account. Multiplying the "ProductsCount" measure by 1000000 and then adding the ProductID gives each Product a unique "SortValue". Of course this approach only works if the ProductID is an integer value.

SortValue = [ProductsCount]*100000 + Products[ProductId] 

3. You can now create a visual with the  Bottom 5 filter set on "SortValue"
TopN_02.PNGTopN_03.PNG


Of course the formula for the "SortValue" formula depends on your actual data. 

 

I hope this helps!

JJ

 

 

Thanks JJ, It worked. Really your explanation was good.

 

Regards,

Shailesh

@Shailu198 glad it works!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.