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.
I need help to wright DAX formula to make a table witр top 2 selling products for every seller. The input data tabler has the following form:
Products | Seller | Sales |
Product1 | Seller1 | 5000 |
Product2 | Seller1 | 5539 |
Product3 | Seller1 | 5892 |
Product4 | Seller1 | 5872 |
Product5 | Seller2 | 9285 |
Product6 | Seller2 | 4928 |
Product7 | Seller2 | 5928 |
Product8 | Seller2 | 9287 |
ProductN… | SellerN… | 9284 |
Solved! Go to Solution.
Hi @Raaassotto
Please try
Top 2 Products =
GENERATE (
VALUES ( 'Table'[Seller] ),
TOPN (
2,
SUMMARIZE (
CALCULATETABLE ( 'Table' ),
'Table'[Product],
"Total Sales", SUM ( 'Table'[Sales] )
),
[Total Sales]
)
)
Hi @Raaassotto
Please try
Top 2 Products =
GENERATE (
VALUES ( 'Table'[Seller] ),
TOPN (
2,
SUMMARIZE (
CALCULATETABLE ( 'Table' ),
'Table'[Product],
"Total Sales", SUM ( 'Table'[Sales] )
),
[Total Sales]
)
)
Covering 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 |
---|---|
47 | |
26 | |
22 | |
12 | |
8 |
User | Count |
---|---|
77 | |
50 | |
46 | |
16 | |
12 |