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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
emilmaican
Frequent Visitor

Cómo calcular el importe de cada artículo en función de su participación

Hola

Tengo una situación y no sé cómo resolverla. Espero que puedas ayudarme.

Mi modelo se ve así:

emilmaican_0-1609928760648.png

Ejemplo de PRODUCTOS de tabla (hay valores duplicados en la columna ProductId):

- cada producto tiene un coste total de producción (en la columna Coste total)

emilmaican_1-1609927550384.png

Ejemplo de tabla RAWMATERIALSHARE (también hay valores duplicados en la columna ProductId):

Cada ProductId está hecho de varios RawMaterials. La división de costo para un determinado ProductId por cada RawMaterialId se muestra en la columna "RawMaterialShare":

emilmaican_2-1609927579002.png

Necesito construir un gráfico/gráfico que muestre el costo de cada RawMaterialId por año

El resultado debe ser el siguiente:

Valores201820192020Gran Total
Oro20005103702880
Plata24506304403520
Platino12503802301860
Cobre3008060440
8700

Gracias

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@emilmaican , Pruebe una nueva medida como

sumx(Summarize(RAWMATERIALSHARE, RAWMATERIALSHARE [productid], RAWMATERIALSHARE[rawmaterialid], "_1", sum(PRODUCTS[TotalCost]) * sum(RAWMATERIALSHARE[rawmaterialshare)]),[_1])

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@emilmaican , Pruebe una nueva medida como

sumx(Summarize(RAWMATERIALSHARE, RAWMATERIALSHARE [productid], RAWMATERIALSHARE[rawmaterialid], "_1", sum(PRODUCTS[TotalCost]) * sum(RAWMATERIALSHARE[rawmaterialshare)]),[_1])

Gracias por la respuesta rápida. Entendí el principio. Parece que falta algo en tu fórmula y estoy tratando de resolverlo.

Encontré la solución. Gracias:

CostByRawMaterial ?
SUMX (
RESUMIR (
RAWMATERIALSHARE,
RAWMATERIALSHARE[productid],
RAWMATERIALSHARE[rawmaterialid],
"_1", SUM ( PRODUCTS[TotalCost] ) * SUM ( RawMaterialShare[RawMaterialShare] )
),
[_1]
)

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.