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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Feb2025 NL Carousel

Fabric Community Update - February 2025

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

Top Kudoed Authors