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
Wimverh
Resolver IV
Resolver IV

Subtotal es suma de división en un nivel inferior

Hola

Tengo problemas para crear la suma de la división en el nivel inferior.
Tengo 2 cálculos, en 2 tablas diferentes, vinculados a un código general (1 con una tabla de muchos tot many en el medio)
En el más bajo los resultados están bien, trato de calcular el valor en rojo (esta es la suma, de las filas en cuadrado naranja)
El cálculo debe seguir funcionando al filtrar productos o Códigos de grupo.
Subtotal_of_calculation.jpg
Siguiente modelo de datos:
Subtotal_of_calculation_dm.jpg
power bi file: https://wimv.be/forumpost/Subtotal_of_calculation.zip

cálculo del inventario Cantidad:

Inventory Qty = SUM([SalesQty])

cálculo de Treshold Qty Rs:

Treshold Qty RS = if(HASONEVALUE(GeneralCode[GeneralCode]);
                    CALCULATE([Treshold Qty];FILTER(GeneralCode;[GeneralCode]<>[GeneralGroupCode]));
                    blank()
                    )

cálculo de Treshold Evaluation TMP:

Treshold Evalulation TMP = 
if(HASONEVALUE(SevesoCode[SevesoGroupCode])
                            ;DIVIDE([Inventory Qty];[Treshold Qty RS]) 
                            ;blank()  // sum formula needed or in a seperate formula
                         )

Saludos

Wim

3 REPLIES 3
Greg_Deckler
Super User
Super User

Va a necesitar SUMMARIZE o GROUPBY y utilizar las funciones X a través de él. Esto parece un problema de totales de medida. Muy común. Vea mi post al respecto aquí: https://community.powerbi.com/t5/DAX-Commands-and-Tips/Dealing-with-Measure-Totals/td-p/63376

Además, esta medida rápida, medida totales, la palabra final debe obtener lo que necesita:
https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/547907


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Thx para responder @Greg_Deckler

Entiendo que necesito crear una tabla de resumen, y tener un sumx en la parte superior.
El problema es crear la tabla resumida en esta configuración específica con muchas 2 relaciones,
al intentar crear la tabla resumida, no está dando valores en el nivel de fila.

Subtotal_of_calculation_formula.jpg

archivo de actualización con tabla resumida: Subtotal_of_calculation_zipfile

@Wimverh

Puede probar la siguiente medida.

Measure =
SUMX (
    VALUES ( GeneralCode[GeneralCode] ),
    DIVIDE (
        [Inventory Qty],
        [Treshold Qty RS]
    )
)

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.