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
Syndicate_Admin
Administrator
Administrator

Obtener un error al intentar agregar un filtro adicional

Hola a todos, Esto está funcionando:

Promedio pagado =
Var PaidAvg =
AVERAGEX (
CALCULABLE (
RESUMIR (
FILTER ('Transacciones', 'Transacciones'[isRowFilter] = 1),
'Transacciones'[Mes],
"TotalPaid", DISTINCTCOUNT ('Transacciones'[Grupo])
),
ALL ('Transacciones'[LineItem]),
ALL ('Calendario'[MonthYearLong]),
USERELATIONSHIP ('Calendario'[Fecha], 'Transacciones'[Fecha de cierre])
),
[TotalPaid]
)

DEVOLUCIÓN PaidAvg


Sin embargo

Var PaidAvg =
AVERAGEX (
CALCULABLE (
RESUMIR (
FILTER ('Transacciones', 'Transacciones'[isRowFilter] = 1),
'Transacciones'[Mes],
"TotalPaid", DISTINCTCOUNT('Transacciones'[Grupo])
),
[TotalPaid]<>0,
ALL ('Transacciones'[LineItem]),
ALL ('Calendario'[MonthYearLong]),
USERELATIONSHIP ('Calendario'[Fecha], 'Transacciones'[Fecha de cierre])
),
[TotalPaid]
)

DEVOLUCIÓN PaidAvg

me da el error:
No se puede determinar el valor de 'TotalPaid'. O bien la columna no existe, o no hay ninguna fila actual para esta columna.

No quiero contar el Grupo si el Total de Pagados es 0 para ese grupo.

¿Cómo agrego el filtro de nivel superior?

1 ACCEPTED SOLUTION

Gracias, he modificado tu código y esto funciona:

Promedio pagado =
AVERAGEX ( FILTRO (
CALCULABLE (
RESUMIR (
FILTER ( 'Transacciones', 'Transacciones'[isRowFilter] = 1 ),
'Transacciones'[Mes],
"TotalPaid", DISTINCTCOUNT ( 'Transacciones'[Grupo] )
),
ALL ( 'Transacciones'[LineItem] ),
ALL ( 'Calendario'[MonthYearLong] ),
USERELATIONSHIP ( 'Calendario'[Fecha], 'Transacciones'[Fecha de cierre] )
),
[TotalPaid] <> 0 ), [TotalPaid] )
DEVOLUCIÓN
PaidAvg

View solution in original post

2 REPLIES 2
Syndicate_Admin
Administrator
Administrator

@FPP ,

Por favor, actualice la fórmula de su medida [Promedio pagado] como se muestra a continuación y verifique si eso es lo que desea ...

Promedio pagado =
VAR _tab =
CALCULABLE (
RESUMIR (
FILTER ( 'Transacciones', 'Transacciones'[isRowFilter] = 1 ),
'Transacciones'[Mes],
"TotalPaid", DISTINCTCOUNT ( 'Transacciones'[Grupo] )
),
ALL ( 'Transacciones'[LineItem] ),
ALL ( 'Calendario'[MonthYearLong] ),
USERELATIONSHIP ( 'Calendario'[Fecha], 'Transacciones'[Fecha de cierre] )
)
VAR PaidAvg =
AVERAGEX ( FILTER ( _tab, [TotalPaid] > 0 ), [TotalPaid] )
DEVOLUCIÓN
PaidAvg

Si lo anterior no puede ayudarlo a obtener el resultado deseado, proporcione algunos datos de muestra en su tabla transacciones (excluir datos confidenciales) con formato de texto y su resultado esperado con lógica de backend y ejemplos especiales. Es mejor si puede compartir un archivo pbix simplificado. Puede consultar el siguiente enlace para cargar el archivo a la comunidad. Gracias.

Cómo subir PBI en la comunidad

Saludos

Gracias, he modificado tu código y esto funciona:

Promedio pagado =
AVERAGEX ( FILTRO (
CALCULABLE (
RESUMIR (
FILTER ( 'Transacciones', 'Transacciones'[isRowFilter] = 1 ),
'Transacciones'[Mes],
"TotalPaid", DISTINCTCOUNT ( 'Transacciones'[Grupo] )
),
ALL ( 'Transacciones'[LineItem] ),
ALL ( 'Calendario'[MonthYearLong] ),
USERELATIONSHIP ( 'Calendario'[Fecha], 'Transacciones'[Fecha de cierre] )
),
[TotalPaid] <> 0 ), [TotalPaid] )
DEVOLUCIÓN
PaidAvg

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.