Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreThe FabCon + SQLCon recap series starts April 14th at 8am Pacific. If you’re tracking where AI is going inside Fabric, this first session is a can't miss. Register now
Hi everyone,
So I used rankx in order to rank sales by client. My client asked me to show TOP 30 clients by sales, I did that filtering the object to show those 30. But my client also wants me to show a table with de percentaje of sales by those TOP 30 and the percentaje of sales of the other clients.
I thought I could use a measure like this: % TOP 30 = calculate( sum(sales); ranking <=30) but Power BI doesn't allow that. How can
I'm pretty sure you just have to turn it around and use a switch statement like
%Top 30 = Switch (true(), ranking<=30, calculate(sum(sales))
You might not need the true( ) expression but, that is a place to start and it would allow you room to calculate the others as well I think.
Hi, thank you for answering. Power BI allowed me to calculate the measure but it showed the total amount of sales.
Facturación = sum('BBDD UTMS'[Total Neto Faena USD]) ; total amount= $ 25.335.100
I'm not totally sure, It seems like it's just not pulling out the ranked as it's supposed to. I would try using ALLSELECTED instead of ALL in your ranking measure.
Changing to allselected didn't work 😞 Thank you for answering, though 🙂
I'm looking at this again, I think the rank formula is not quite right.
Try replacing the Calculate portion with your measure for the sum of sales.
I hope that works for you.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 52 | |
| 44 | |
| 44 | |
| 20 | |
| 19 |
| User | Count |
|---|---|
| 71 | |
| 70 | |
| 34 | |
| 33 | |
| 31 |