Forum Discussion
Redraidas1
Helper I
5 years agoHow to get TOP10
I'm trying to limit my DAX top give me the the SUM of TOP10 sales, however, DAX seems to be ignoring my TOP10 request and won't limit the caluclation to TOP 10 only. Any ideas? Thanks! CALCULATE...
- Anonymous5 years ago
Hi Redraidas1 ,
You could consider to create a measure using RANKX() function.
Then add this measure to filter to filter the data that rank value is less than 10.
For example:
_sum = SUM('Table'[value]) _rank = RANKX(ALL('Table'),[_sum])Best Regards,
Jay
VijayP
Community Champion
5 years agoCALCULATE (
SUM ( AfterSales_BM[ABCValue] ),
TOPN( 10, AfterSales_BM, AfterSales_BM[ABCValue]),
FILTER (
Config,
Config[FieldCode] = "1"
),Distinct(ColumnName)
)
The bold one is which column you want to see the Rank (most probably AferSales_BM)?!
Please do let me know whether this helped!
Redraidas1
Helper I
5 years agoI changed it, but the problem is still there.
DAX:
CALCULATE (
SUM ( AfterSales_BM[ABCValue] ),
TOPN( 5, AfterSales_BM, AfterSales_BM[ABCValue]),
FILTER (
Dim_Report_Config,
Dim_Report_Config[FieldCode] = "1"
), DISTINCT(AfterSales_BM[ABCValue])
)