Forum Discussion
powerbiuser9999
4 years agoHelper I
TOPN function in CALCULATE
Hi I have an interesting problem when trying to create a measure in PBI Desktop. I have data thats akin to this, which I have used SUMMARIZE to create categories and a count of their respective...
- 4 years ago
Hi, powerbiuser9999
You can try the following methods.
- Create a new calculation column to rank the COUNT of sales.
Rank = RANK.EQ ( [COUNT of sales], 'Table'[COUNT of sales], DESC )2. Create a measure to sum the top five.
Measure = CALCULATE ( SUM ( 'Table'[COUNT of sales] ), FILTER ( ALL ( 'Table' ), 'Table'[Rank] <= 5 ) )Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more.
v-zhangti
4 years agoCommunity Support
Hi, powerbiuser9999
You can try the following methods.
- Create a new calculation column to rank the COUNT of sales.
Rank =
RANK.EQ ( [COUNT of sales], 'Table'[COUNT of sales], DESC )
2. Create a measure to sum the top five.
Measure =
CALCULATE (
SUM ( 'Table'[COUNT of sales] ),
FILTER ( ALL ( 'Table' ), 'Table'[Rank] <= 5 )
)
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more.
powerbiuser9999
4 years agoHelper I
v-zhangti Charlotte. You star! Thank you!