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
Anonymous
Not applicable

Jerarquías & Agregación

Hola

Estoy tratando de lograr Agregaciones y Jerarquías, tengo 4 tablas

Tabla de productos

Categoría de producto

Hecho de ventas

SalesAgg (agregado a la categoría de producto)

I Los nombres de productos se acumulan en la categoría de producto. Así que tengo un SalesAgg agregado que apunta a la categoría del producto.

Necesito crear una jerarquía en Categoría de producto -> Nombre del producto, para que tanto la agregación como la jerarquía funcionen. Por favor, hágamelo saber cómo lograr esto

Gracias de antemano,

Prashanth

9 REPLIES 9
v-alq-msft
Community Support
Community Support

Hola, @Prashanth_M

Si toma la respuesta de alguien, márquela como la solución para ayudar a los otros miembros que tienen los mismos problemas a encontrarlo más rápidamente. Si no, avísame y trataré de ayudarte más. Gracias.

Saludos

Allan

v-alq-msft
Community Support
Community Support

Hola, @Prashanth_M

Según su descripción, creé datos para reproducir su escenario.

Producto:

c1.png

Categoría del producto:

c2.png

Hecho de venta:

c3.png

Relaciones:

c4.png

Puede crear una medida o una tabla calculada como se muestra a continuación.

Measure:
Sales measure = 
var _category = SELECTEDVALUE('Product Category'[Product Category])
return
IF(
    ISINSCOPE('Product'[ProductName]),
    SUM('Product'[Price])*SUM('Product'[Quantity]),
    SUMX(
        FILTER(
            ALL('Product'),
            RELATED('Product Category'[Product Category]) = _category
        ),
        'Product'[Price]*'Product'[Quantity]
    )
)
Calculated table:
SalesAgg = 
SUMMARIZE(
    'Product Category',
    'Product Category'[Product Category],
    "Sales",
    var _category = 'Product Category'[Product Category]
    return
    SUMX(
        FILTER(
            ALL('Product'),
            RELATED('Product Category'[Product Category]) = _category
        ),
        [Price]*[Quantity]
    )
)

Resultado:

c5.png

Saludos

Allan

Si este post ayuda,entonces por favor considere Aceptarlo como la solución para ayudar a los otros miembros a encontrarlo más rápidamente.

parry2k
Super User
Super User

@Prashanth_M por qué no agregar al nivel de producto?



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Anonymous
Not applicable

@parry2k , Categoría de producto es un nivel más alto de nombres de productos, por lo que se agrega para el rendimiento.

@Prashanth_M bien, puede agregar la categoría de producto de jerarquía -> Nombre del producto, pero cuando profundiza en el nombre del producto va a la tabla no agregada, ¿no está seguro de cuál es realmente la pregunta/problema aquí?



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Anonymous
Not applicable

@parry2k , como Categoría de producto y Nombre de producto están en tablas diferentes, ¿cómo puedo crear una jerarquía

@Prashanth_M puede quitar estas columnas en el objeto visual, suponiendo que está utilizando el objeto visual de matriz, en las filas, puede quitar la categoría de la tabla de categoría de producto y el nombre del producto de la tabla de productos.

Me gustaría elogiossi mi solución me ayudó.👉Si puedes pasar tiempo publicando la pregunta, también puedes hacer esfuerzos para darle a Kudos quien haya ayudado a resolver tu problema. ¡Es una muestra de agradecimiento!



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Anonymous
Not applicable

@parry2k , soy nuevo en Power BI y estoy intentando crear un modelo de datos para que los usuarios puedan consumirlo, ya que hay muchas tablas, estoy intentando mostrar la categoría del producto y el nombre del producto en un solo lugar para que sea fácil para los usuarios consumirlo desde allí (aún haciendo que las agregaciones funcionen en el back-end)

@Prashanth_M probaste lo que te propuse.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

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.