Forum Discussion
Sort bubble size by multiple legends?
Hi,
I am fairly new to Power BI and only know basic programming, so I might have missed the solution in my searches.
I will try to explain the best I can...
I am creating a bubble chart to analyze sales metrics and I want to size each bubble relative to Profits and order type.
Currently it sums all profits no matter order type. As seen in the picture below, the bubbles for customer ID "15760" are the same size as they both sum the collective profits for that customer.
Edit: The customer 15760 has previously purchased by two different order types, and I want to size the bubble by each respective profit. Currently, they are the same size because it sums the customers collective profits. Not the profits by order type.
The following code works, but only for one order type and I need it to sort for each order type.
I have been experimenting with IF/ELSE statements, but have not succeeded.
Profits by Order type =
CALCULATE(
SUM('EarningsTable'[Profits]),
'EarningsTable'[OrderType] = { "Order type 1" }
)
Each tables EarningsTable[] looks like the following:
| Customer ID | Order no. | Order type | Profits |
| 15760 | Order 1 | TRX | X |
| 15760 | Order 2 | R18 | Y |
| 15760 | Order 3 | R18 | Z |
| 17894 | Order 4 | SAT | K |
Table relationships are by Customer ID (Kund or Kundnr)
Expected results:
- Bubble = Customer Sales by Order type
- Bubble Color = Order Type
- Bubble Size = Profits of each Order Type
I believe this is all, thank you in advance!
- Anonymous5 years ago
Hello again,
I believe I have solved it.
I took out another Excel from our ERP with that summerized the total Cost for each Order No. and Order Type, set the Relation between Order No.
So far, it seems to be correct.
3 Replies
- amitchandakSuper User
Anonymous , You are using order type as legend, why are you using order type filter in measure
Profits by Order type =
CALCULATE(
SUM('EarningsTable'[Profits])
)- AnonymousNot applicable
Yes, because customers can purchase from all order types and I need to see the profits of each order type.
If I use 'EarningsTable'[Profits] it displays the same earnings for each bubble. I believe this is because it sums all profits for that Customer. I want it to be sorted by Customers and Order Type.
- AnonymousNot applicable
Hello again,
I believe I have solved it.
I took out another Excel from our ERP with that summerized the total Cost for each Order No. and Order Type, set the Relation between Order No.
So far, it seems to be correct.