Forum Discussion
Anonymous
4 years agoNot applicable
Using TOPN not giving expected result
Hi Experts First I need to mention that this is through a live connection. All have a correct connection. After reading several posts, I thought my measure was ready for the task, but no. There are...
- 4 years ago
As smpa01 mentioned, while SUMMARIZECOLUMNS is great for DAX queries but isn't useful inside measures.
I don't think you need it here though. Try this:
#Top 20 PostalCodes SalesNet = VAR _Exclude = FILTER ( KEEPFILTERS ( VALUES ( 'Customer'[Customer Postal Code] ) ), 'Customer'[Customer Postal Code] <> "n/a" ) VAR _SalesPerCode = ADDCOLUMNS ( _Exclude, "@SalesNet", [Sales Net] ) VAR _TOP20 = TOPN ( 20, _SalesPerCode, [@SalesNet] ) RETURN SUMX ( _TOP20, [@SalesNet] )
smpa01
Community Champion
4 years agoAnonymous SUMMARIZECOLUMNS can't be utilized in a measure. It only works in DAX table expression.