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

Valor medio total general de columna incorrecto en la matriz de cohortes

¡Hola a todos!

Tengo una matriz de cohortes donde debo calcular el valor promedio. El valor se calculó correctamente (debería obtener el pago medio por factura en 1,2,3 meses después de la factura) pero obtuve un total general incorrecto.

Tengo medidas:

Valor medio: DIVIDE([Cohort Sum NetAmount], [Recuento de facturas de cohortes], 0)
Cohort Sum NetAmount - SUM ( FactPayoutsEarnings[NetAmount] )
Contar las facturas de la cohorte ?COUNT (FactCohortInvoicesPBI[Id] ) (cómo restringir este)

El principal problema es que "Count cohort invoices" toma todos los valores. Por ejemplo:

Las facturas creadas en 201907 después de 10 meses obtienen 3.09 y el total total debe ser 3.09

Ejemplo de PBIX adjunto

1 ACCEPTED SOLUTION

Hola @vk_pro ,

Creé una nueva medida "[Measure_Copy]" que es lo mismo que "[Valor medio]". A continuación, utilice AVERAGEX() para obtener el valor total( si desea sumar valores, puede utilizar SUMX ).

Measure =
AVERAGEX (
    ALLSELECTED ( FactCohortInvoicesPBI[Invoices created month] ),
    [Measure_Copy]
)

A continuación, edite la medida "[Valor medio]" como:

Average value =
VAR a =
    DIVIDE ( [Cohort Sum NetAmount], [Count cohort invoices], 0 )
RETURN
    IF ( ISINSCOPE ( FactCohortInvoicesPBI[Invoices created month] ), a, [Measure] )

Aquí está el resultado.

3-1.PNG

Aquí está el archivo para su referencia.

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

View solution in original post

4 REPLIES 4
Greg_Deckler
Super User
Super User

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...
Greg_Deckler
Super User
Super User

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

Hola Greg! Gracias por la respuesta, pero no he cogido exactamente cómo restringir el denominador. Parece que eres un experto en ello. He adjuntado el archivo pbix en el primer mensaje. ¿Puedes aclararme una medida? Me lo agradecería mucho

Hola @vk_pro ,

Creé una nueva medida "[Measure_Copy]" que es lo mismo que "[Valor medio]". A continuación, utilice AVERAGEX() para obtener el valor total( si desea sumar valores, puede utilizar SUMX ).

Measure =
AVERAGEX (
    ALLSELECTED ( FactCohortInvoicesPBI[Invoices created month] ),
    [Measure_Copy]
)

A continuación, edite la medida "[Valor medio]" como:

Average value =
VAR a =
    DIVIDE ( [Cohort Sum NetAmount], [Count cohort invoices], 0 )
RETURN
    IF ( ISINSCOPE ( FactCohortInvoicesPBI[Invoices created month] ), a, [Measure] )

Aquí está el resultado.

3-1.PNG

Aquí está el archivo para su referencia.

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

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.