Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

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

 

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!

  • Anonymous's avatar
    Anonymous
    5 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

  • 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])
    )

    • Anonymous's avatar
      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.

       

       

  • Anonymous's avatar
    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.