Forum Discussion
TOP N Disappear
- 3 years ago
Hi Antonio_Gomez ,
According to your code, I create a sample and test. If you put the CantPract part in the RETURN field, you will find it take each row into consideration instead of the whole table.
Modify it to:
TopNPracticos = VAR CantPract = CALCULATE ( COUNT ( Empleado[CodigoPractico] ), ALL ( 'Empleado' ) ) VAR TopNValue = ROUNDUP ( CantPract / 2, 0 ) VAR TopPPracticos = TOPN ( TopNValue, ALLSELECTED ( Empleado ), Empleado[Mov] ) VAR TopNManiobras = CALCULATE ( SELECTEDVALUE ( Empleado[Mov] ), KEEPFILTERS ( TopPPracticos ), FILTER ( Empleado, Empleado[CodigoPractico] <> "X" ) ) RETURN TopNManiobrasGet the correct result:
I attach my sample below for your reference.
Best Regards,
Community Support Team _ kalyjIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Antonio_Gomez ,
According to your code, I create a sample and test. If you put the CantPract part in the RETURN field, you will find it take each row into consideration instead of the whole table.
Modify it to:
TopNPracticos =
VAR CantPract =
CALCULATE ( COUNT ( Empleado[CodigoPractico] ), ALL ( 'Empleado' ) )
VAR TopNValue =
ROUNDUP ( CantPract / 2, 0 )
VAR TopPPracticos =
TOPN ( TopNValue, ALLSELECTED ( Empleado ), Empleado[Mov] )
VAR TopNManiobras =
CALCULATE (
SELECTEDVALUE ( Empleado[Mov] ),
KEEPFILTERS ( TopPPracticos ),
FILTER ( Empleado, Empleado[CodigoPractico] <> "X" )
)
RETURN
TopNManiobras
Get the correct result:
I attach my sample below for your reference.
Best Regards,
Community Support Team _ kalyj
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.