Forum Discussion
Top 20 Percentage
Hi all!
Completing a finance report where i have a list of top 20 clients and the totals - but now i want to see how it compares t to the full table so in this case - what percentage of net revenue comes from top 20 clients,
HELP
What you see here is the totals row of the top 20
Hi Anonymous ,
I created the sample data.
Then use these measures to calculate top n values.
RankClients = RANKX ( ALLSELECTED ( 'Table'[clients] ), CALCULATE ( SUM ( 'Table'[amount] ) ), , DESC, SKIP )Top N Percentage = VAR N = 3 VAR totalamount = SUMX ( ALL ( 'Table' ), 'Table'[amount] ) VAR TopNTotal = CALCULATE ( SUM ( 'Table'[amount] ), FILTER ( ALLSELECTED ( 'Table'[clients] ), [RankClients] <= N ) ) RETURN DIVIDE ( TopNTotal, totalamount )If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
4 Replies
- lbendlin
Super User
This is standard DAX filter modification. What have you tried so far and where are you stuck?
- AnonymousNot applicable
havent tried any yet so please some guidence
- lbendlin
Super User
Please provide sanitized sample data that fully covers your issue. If you paste the data into a table in your post or use one of the file services it will be easier to assist you. Avoid posting screenshots of your source data if possible.
Please show the expected outcome based on the sample data you provided. Screenshots of the expected outcome are ok.
https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523
- v-kkf-msft
Community Support
Hi Anonymous ,
I created the sample data.
Then use these measures to calculate top n values.
RankClients = RANKX ( ALLSELECTED ( 'Table'[clients] ), CALCULATE ( SUM ( 'Table'[amount] ) ), , DESC, SKIP )Top N Percentage = VAR N = 3 VAR totalamount = SUMX ( ALL ( 'Table' ), 'Table'[amount] ) VAR TopNTotal = CALCULATE ( SUM ( 'Table'[amount] ), FILTER ( ALLSELECTED ( 'Table'[clients] ), [RankClients] <= N ) ) RETURN DIVIDE ( TopNTotal, totalamount )If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.