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.
Hi,
I need to show top N categories and their production in the Matrix with Catg--> Product heirarchy.
Please help me on this
Top 3 Categories | |||
Category | Product | Sales | Rank |
Catg1 | 100 | 3 | |
PROD1 | 80 | ||
PROD2 | 20 | ||
Catg2 | 150 | 2 | |
PROD3 | 100 | ||
PROD4 | 20 | ||
PROD5 | 30 | ||
Catg3 | 300 | 1 | |
PROD6 | 100 | ||
PROD7 | 200 |
Thanks,
Kalyan
Solved! Go to Solution.
Hi,
Please try this measure:
Measure =
IF (
ISINSCOPE ( 'Table'[Product] ),
BLANK (),
RANKX (
SUMMARIZE (
ALLSELECTED ( 'Table' ),
'Table'[Category],
"Total", SUM ( 'Table'[Sales] )
),
[Total],
SUM ( 'Table'[Sales] ),
DESC,
DENSE
)
)
The result shows:
Here is my test pbix file:
Hope this helps.
Best Regards,
Giotto
Hi,
Please try this measure:
Measure =
IF (
ISINSCOPE ( 'Table'[Product] ),
BLANK (),
RANKX (
SUMMARIZE (
ALLSELECTED ( 'Table' ),
'Table'[Category],
"Total", SUM ( 'Table'[Sales] )
),
[Total],
SUM ( 'Table'[Sales] ),
DESC,
DENSE
)
)
The result shows:
Here is my test pbix file:
Hope this helps.
Best Regards,
Giotto
Refer this should help
https://www.sqlbi.com/articles/filtering-the-top-3-products-for-each-category-in-power-bi/
While certianly possible, this would be much MUCH easier for us to help to get a copy of your source table data, not your matrix. Otherwise we have to recreate the data for you.
How to get good help fast. Help us help you.
How to Get Your Question Answered Quickly
How to provide sample data in the Power BI Forum
DAX is for Analysis. Power Query is for Data Modeling
Proud to be a Super User!
MCSA: BI ReportingCovering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
98 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
100 | |
86 | |
64 |