Forum Discussion

Selvin's avatar
Selvin
New Member
2 years ago
Solved

Explosion de datos

Hola,

 

Trabajo para una coorporación de manufactura, y necesitamos empezar a medir los consumos de accesorios por cada prenda costurada.

 

Tengo 2 datas:

1-DATA BOM: Esta data es la base donde me refleja: construcción,estilo, color, talla, los accesorios necesarios para costurar dicho estilo, y su consumo respectivo como por ejemplo

 

CX                                      Estilo            Color                            Talla               Accesorio            Consumo

SS BASIC TEE AB TA           PC54            LEMON YELLOW           XL                 CAJA                    0.02778

SS BASIC TEE AB TA           PC54            LEMON YELLOW           XL                 CASE LABES         0.02778

SS BASIC TEE AB TA           PC54            LEMON YELLOW           XL                 LABEL                   1

SS BASIC TEE AB TA           PC54            LEMON YELLOW           XL                 LANA                    0.00373

SS BASIC TEE AB TA           PC54            LEMON YELLOW           XL                 ROBBON               0.00002

SS BASIC TEE AB TA           PC54            LEMON YELLOW           XL                 TAPE                      0.00047

 

DATA 2 PRODUCCIÓN, Está data me refleja la planta que realizo la producción, construcción, estilo, color, talla, cantidad en piezas, cantidad en docenas. Como por ejemplo.

 

Planta     CX                                    Estilo        Color                        Talla              Cant piezas             Cant docenas

5 star      SS BASIC TEE AB TA         PC54         LEMON YELLOW      XL                 2000                        166.66

 

 

Necesito hacer una explosión de datos para que en la data 2, me desgloce los accesorios de dicho estilo, la cantidad en piezas debe ser repetitiva para cada linea para calcular el consumo real. por ejemplo 

 

Para calcular el consumo es:

Cantidad de piezas producidas * el consumo del accesorios. 

 

Favor si alguien me dar un solución, se lo agradeceria.

 

Saludos.

  • Hi Selvin 

    It seems you don't have ID's which can be used directly to link the tables. You you have them please use them. If not, you can use a strategy which leverages composite keys.

     

    1. Create Composite Keys:

      • In both datasets, create a new column that concatenates the product attributes to form a unique key for each product.
        Key = DATA BOM[CX] & "-" & DATA BOM[Style] & "-" & DATA BOM[Color] & "-" & DATA BOM[Size]
    2. Relate the Tables:

      • Use the newly created keys to establish a relationship between the tables in the "Model" view.
    3. Calculate Actual Consumption:

      • Once the tables are related, you can create a new column in the production table to calculate the actual consumption:
        Actual Consumption = DATA 2 PRODUCTION[Pieces Quantity] * RELATED(DATA BOM[Consumption])
    4. Visualize:

      • Use the tables to create visuals in Power BI to analyze the actual accessory consumption.

    Creating a composite key based on product attributes ensures that you can link the tables accurately, even if there's no pre-existing unique identifier. Let me know if it worked!


    Pedro Reis - Data Platform MVP / MCT
    Making Power BI and Fabric Simple

    If my response resolved your issue, please mark it as a solution to help others find it. If you found it helpful, please consider giving it a kudos. Your feedback is highly appreciated!

    Find me at LinkedIn

1 Reply

  • pmreis's avatar
    pmreis
    Most Valuable Professional

    Hi Selvin 

    It seems you don't have ID's which can be used directly to link the tables. You you have them please use them. If not, you can use a strategy which leverages composite keys.

     

    1. Create Composite Keys:

      • In both datasets, create a new column that concatenates the product attributes to form a unique key for each product.
        Key = DATA BOM[CX] & "-" & DATA BOM[Style] & "-" & DATA BOM[Color] & "-" & DATA BOM[Size]
    2. Relate the Tables:

      • Use the newly created keys to establish a relationship between the tables in the "Model" view.
    3. Calculate Actual Consumption:

      • Once the tables are related, you can create a new column in the production table to calculate the actual consumption:
        Actual Consumption = DATA 2 PRODUCTION[Pieces Quantity] * RELATED(DATA BOM[Consumption])
    4. Visualize:

      • Use the tables to create visuals in Power BI to analyze the actual accessory consumption.

    Creating a composite key based on product attributes ensures that you can link the tables accurately, even if there's no pre-existing unique identifier. Let me know if it worked!


    Pedro Reis - Data Platform MVP / MCT
    Making Power BI and Fabric Simple

    If my response resolved your issue, please mark it as a solution to help others find it. If you found it helpful, please consider giving it a kudos. Your feedback is highly appreciated!

    Find me at LinkedIn