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

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

Reply
Syndicate_Admin
Administrator
Administrator

Tablas de Power bi

Tabla actual

Y.PARTRESFAVOR
110011A
110011B
110011C
110011D
110022B
110023O
210031B

Tabla obligatoria

Y.PARTRESFAVOR
110011DIBUJAR
110023O
210031B

Gracias

1 ACCEPTED SOLUTION
Syndicate_Admin
Administrator
Administrator

Al modificar la consulta anterior, podemos obtener nuestro resultado requerido
es decir,

#PART_WINNING_PARTY =
DÓNDE _contar =
CALCULAR (
..MAX ( 'TABLA'[RES] ),
TODOS excepto ( 'TABLA', 'TABLA'[PARTE] )
)

DÓNDE _comprobar =
CALCULAR (
HASONEVALUE ( 'TABLA'[RESQ] ),
TODOS excepto ( 'TABLA', 'TABLA'[PARTE] )
)

DÓNDE _isDraw =
SI (
_comprobar = FALSO (),
SI (
COUNTROWS (
FILTRO (
'TABLA',
'TABLA'[PARTE] = ANTERIOR ( 'TABLA'[PARTE] ) &&
'TABLA'[RES] <> _contar
)
) = 0,
"DIBUJAR",
ESPACIO EN BLANCO ()
),
ESPACIO EN BLANCO ()
)

DEVOLUCIÓN
SI (
ISBLANK ( _isDraw ),
CALCULAR (
..MAX ( 'TABLA'[RESQ] ),
FILTRO (
'TABLA',
'TABLA'[PARTE] = ANTERIOR ( 'TABLA'[PARTE] ) &&
'TABLA'[RES] = _contar
)
),
_isDraw
)

View solution in original post

4 REPLIES 4
Syndicate_Admin
Administrator
Administrator

Al modificar la consulta anterior, podemos obtener nuestro resultado requerido
es decir,

#PART_WINNING_PARTY =
DÓNDE _contar =
CALCULAR (
..MAX ( 'TABLA'[RES] ),
TODOS excepto ( 'TABLA', 'TABLA'[PARTE] )
)

DÓNDE _comprobar =
CALCULAR (
HASONEVALUE ( 'TABLA'[RESQ] ),
TODOS excepto ( 'TABLA', 'TABLA'[PARTE] )
)

DÓNDE _isDraw =
SI (
_comprobar = FALSO (),
SI (
COUNTROWS (
FILTRO (
'TABLA',
'TABLA'[PARTE] = ANTERIOR ( 'TABLA'[PARTE] ) &&
'TABLA'[RES] <> _contar
)
) = 0,
"DIBUJAR",
ESPACIO EN BLANCO ()
),
ESPACIO EN BLANCO ()
)

DEVOLUCIÓN
SI (
ISBLANK ( _isDraw ),
CALCULAR (
..MAX ( 'TABLA'[RESQ] ),
FILTRO (
'TABLA',
'TABLA'[PARTE] = ANTERIOR ( 'TABLA'[PARTE] ) &&
'TABLA'[RES] = _contar
)
),
_isDraw
)
Syndicate_Admin
Administrator
Administrator

Usé el dax anterior y funciona bien para la mayoría de los casos, pero en caso de RES único por PARTE, devuelve "DRAW" también, lo que no es correcto, debería devolver el valor sigle como recuento máximo. Supongo que necesito modificar la consulta para manejar ese problema. Cualquier sugerencia

Gracias

Syndicate_Admin
Administrator
Administrator

Se encontró una posible solución mediante esta columna calculada
es decir,

#PART_WINNING =
DÓNDE _contar =
CALCULAR (
..MAX ( 'TABLA'[RES] ),
TODOS excepto ( 'TABLA', 'TABLA'[PARTE] )
)
DÓNDE _isDraw =
SI (
COUNTROWS (
FILTRO (
'TABLA',
'TABLA'[PARTE] = ANTERIOR ( 'TABLA'[PARTE] ) &&
'TABLA'[RES] <> _contar
)
) = 0,
"DIBUJAR",
ESPACIO EN BLANCO ()
)
DEVOLUCIÓN
SI (
ISBLANK ( _isDraw ),
CALCULAR (
..MAX ( 'TABLA'[RESQ] ),
FILTRO (
'TABLA',
'TABLA'[PARTE] = ANTERIOR ( 'TABLA'[PARTE] ) &&
'TABLA'[RES] = _contar
)
),
_isDraw
)
Syndicate_Admin
Administrator
Administrator

Solución según el requisito: -
#column =
DÓNDE _contar =
CALCULAR (
..MAX ( 'TABLA'[RES] ),
TODOS excepto ( 'TABLA', 'TABLA'[PARTE] )
)
DÓNDE _isDraw =
SI (
COUNTROWS (
FILTRO (
'TABLA',
'TABLA'[PARTE] = ANTERIOR ( 'TABLA'[PARTE] ) &&
'TABLA'[RES] <> _contar
)
) = 0,
"DIBUJAR",
ESPACIO EN BLANCO ()
)
DEVOLUCIÓN
SI (
ISBLANK ( _isDraw ),
CALCULAR (
..MAX ( 'TABLA'[RESQ] ),
FILTRO (
'TABLA',
'TABLA'[PARTE] = ANTERIOR ( 'TABLA'[PARTE] ) &&
'TABLA'[RES] = _contar
)
),
_isDraw
)

Helpful resources

Announcements
Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

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

Top Kudoed Authors