Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hi,
I want to show the top 3 verticals by sales as a % of grand total (not top 5 total).
Example
Industry | Sales | show in table or stacked column |
A | 40 | 40% |
B | 30 | 30% |
C | 20 | 20% |
D | 6 | |
E | 4 |
Solved! Go to Solution.
Hi @shalabh ,
Please follow these steps:
SORT =
RANKX (
FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Sales] ),
CALCULATE ( MAX ( 'Table'[Sales] ) ),
,
DESC
)
RESULT =
VAR _1 =
SUMX ( ALL ( 'Table' ), 'Table'[Sales] )
VAR _2 =
MAX ( 'Table'[Sales] ) / _1
RETURN
IF ( 'Table'[SORT] <= 3, _2, BLANK () )
3.final output
How to Get Your Question Answered Quickly - Microsoft Fabric Community
If it does not help, please provide more details with your desired out put and pbix file without privacy information.
Best Regards,
Yifan Wang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @shalabh ,
Please follow these steps:
SORT =
RANKX (
FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Sales] ),
CALCULATE ( MAX ( 'Table'[Sales] ) ),
,
DESC
)
RESULT =
VAR _1 =
SUMX ( ALL ( 'Table' ), 'Table'[Sales] )
VAR _2 =
MAX ( 'Table'[Sales] ) / _1
RETURN
IF ( 'Table'[SORT] <= 3, _2, BLANK () )
3.final output
How to Get Your Question Answered Quickly - Microsoft Fabric Community
If it does not help, please provide more details with your desired out put and pbix file without privacy information.
Best Regards,
Yifan Wang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@shalabh , You can create a measure
% of Top 3 = Divide(
Sumx(keepfilters(topn(3, allselected('Table'[Industry]) ,Sum('Table'[Sales]), desc)),CALCULATE(Sum('Table'[Sales]))) ,
Calculate(sum('Table'[Sales]) , topn(3, allselected('Table'[Industry]) ,Sum('Table'[Sales]), desc)))
I tried this but it is showing all the industries. I want to show only say top 3 industries and percentage contribution of each against the total
User | Count |
---|---|
84 | |
73 | |
67 | |
42 | |
35 |
User | Count |
---|---|
109 | |
56 | |
52 | |
45 | |
43 |