Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now
Hi folks,
Data structure:
Category A: Product1,Product2,Product3.....so on
Category B: Product1,Product2,Product3.....so on
I want to calculate Top 5 and Bottom 5 products within each category.For Top 5 Products within each category I have used this formula:
Top 5 Products within each category =
VAR RankingContext = VALUES(‘Dim Products’[Products])
return
CALCULATE([Sum of sales],TOPN(5,ALL(‘Dim Products’[Products]),[Sum of sales]),RankingContext)
I am using Category and Product(Drill down) in rows section of Matrix and the Measure " Top 5 Products within each category" in the values section.
Its working well for Top 5 but I need help in calculating the bottom 5 products within each category.
Thanks in advance.
Hi @Ajinkya369,
Can please share some dummy data with a similar data structure and expected results? It should help us clarify your scenario and test to coding formula.
How to Get Your Question Answered Quickly
Regards,
Xiaoxin Sheng
Hey @amitchandak ,
Thanks for the reply! It is for Top N products within each category whereas I am looking for Bottom N Products within each category.
Thanks,
Ajinkya
@Ajinkya369 , refer if this can help
https://www.sqlbi.com/articles/filtering-the-top-3-products-for-each-category-in-power-bi/
User | Count |
---|---|
114 | |
94 | |
87 | |
75 | |
65 |
User | Count |
---|---|
138 | |
112 | |
110 | |
98 | |
94 |