Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

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.

 

ProfitsByOrderType.png

 

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 IDOrder no.Order typeProfits
15760Order 1TRXX
15760Order 2R18Y
15760Order 3R18Z
17894Order 4SATK

 

Table relationships are by Customer ID (Kund or Kundnr)

Relationship.png

 

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!

1 ACCEPTED SOLUTION
Anonymous
Not 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. 

View solution in original post

3 REPLIES 3
Anonymous
Not 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. 

amitchandak
Super User
Super 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])
)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not 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.

 

Profits.png

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.