Forum Discussion
Anonymous
6 years agoNot applicable
TopN with duplicates
Hi guys, I would like to create a TOPN measure that sums up the revenues generated by the 2 most high-selling products. However, my table (a simplified version below) contains duplicates. Is it pos...
- 6 years ago
Please try this expression in a measure to get your desired result.
Top 2 Sum = VAR summary = ADDCOLUMNS ( VALUES ( 'Table'[Product ID] ), "@total", CALCULATE ( SUM ( 'Table'[Revenue EURO] ) ) ) RETURN SUMX ( TOPN ( 2, summary, [@total], DESC ), [@total] )If this works for you, please mark it as the solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat
Anonymous
6 years agoNot applicable
Hi Anonymous
Create a measure as
Measure = CALCULATE(SUMX(TOPN(2,VALUES('Table'[Revenue]),'Table'[Revenue],DESC),'Table'[Revenue])) Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Regards,
Pranit