Forum Discussion
How to get TOP10
- 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
5 Replies
- VijayPCommunity ChampionCALCULATE (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!
- Redraidas1Helper I
I 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]))
- VijayPCommunity Champion
Use this Function
VAR = RankofABC = Rankx(all(AfterSales_BM[ColumnName]),sum(abcvalue))
return
calculate(sum(abcvalue),filter(all(all(AfterSales_BM[ColumnName]),RankofABC<=10),distinct(columname)) - parry2kSuper User
Redraidas1 it is not as straightforward as it looks like, you are doing top 10 on a table and also filtering on another table. Also what are your expectation when you are seeing the data below, let's say we want the top 3 (would you like to see (200 + 40 + 30, = 270 since these are top 3 values ), or you want it to sum by the customer and then take top 3 in that case from the data below the result will be (A = 15, B = 30, C = 200, D = 70 and top 3 will be then 200 + 70 + 30 = 300)
A - 10
A - 5
B - 20
B - 10
C - 200
D - 30
D - 40
It will be easier if you share pbix file using one drive/google drive with the expected output. Remove any sensitive information before sharing.
- AnonymousNot applicable
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