Forum Discussion
Hitting a Roadblock
m_wex , Power bi context sensitive. So If you use any thing other than category , then it will give top 5 inside that.
You can top 5/N category
Measure =
var _cat = TOPN(10,all('Product Category (2)'[Product Category] ),[Total Sales],DESC)
return
calculate([Total Sales], filter( 'Product Category (2)','Product Category (2)'[Product Category] in _cat))
This should give you only top category
refer this how sub category works - https://www.sqlbi.com/articles/filtering-the-top-3-products-for-each-category-in-power-bi/
- m_wex5 years ago
Helper I
amitchandak: Thank you for the quick response. Will give this a go.
- m_wex5 years ago
Helper I
Was not able to get the desired result with this. The main result (product category) is shown using a check box for top sales (5, 10, 25, all). If 5 is selected then only the top 5 categories sales are shown on a bar chart. What I am tring to do next is display another graph showing sales by sub-groups only for the category groups from the first graph. In my real world case for 5 catgories there would be 11 sub-groups. The results from one graph are used as a filter for a second graph.