Forum Discussion

brunofranc's avatar
brunofranc
Frequent Visitor
6 years ago
Solved

Count Services inside a Promo Combo Sales

How can I count diferent sales inside Combo Order? 
There is a table with all services (table_services) and another with combos (table_combos).
In the "transactions_table" use all the codes, but the challenge is report total of services and minutes sales in a bar graphic.

 

For Examples:
Service 1 - 10 Sales - 300 minutes

Service 2 - 10 Sales - 450 minutes

...

Is possible create a measure to calculate this?

 

The tables are bellow:

table_services

IDServiceNameDuration (min)
501Service130
502Service245
503Service390
504Service460

 

table_combos

IDcombosDescription
10052 x 502  + 3 x 504
10066 x 501

 

transactions_table

DateOrderidClientidIDs
20/02/2019

0123

0011005
20/02/20190123001504
01/03/201901560021006
02/03/20190189003501

 

6 Replies

    • brunofranc's avatar
      brunofranc
      Frequent Visitor

      It's not in this way.
      Maybe like this: 
      The ID equals a sum  of other 2 IDs.

  • v-lionel-msft's avatar
    v-lionel-msft
    Icon for Community Support rankCommunity Support

    Hi brunofranc ,

     

    How are these two values calculated? I don't quite understand their calculation logic.

     

    Best regards,
    Lionel Chen

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

    • brunofranc's avatar
      brunofranc
      Frequent Visitor
       
       

      For example, in order id 123, there are 1 combo 1005 and 1 of 504. 
      Combo 1005 is:

       

      2 x IDService 502 and 3 x Service ID504


      And then 2 x 45 = 90 min 

                     3 x 60 = 180 min
      And the amount is 2 +3 = 5