Forum Discussion
CONTAR.SI con formula DAX
Buenas tardes,
Quisiera preguntar como puedo generar una formula en DAX que me permita ver cuantas veces se repite una variable, esto agregando una nueva columna, lo que por ejemplo en excel usaría la formula CONTAR.SI.
Tengo la siguiente base de datos y el resultado esperado:
- Anonymous3 years ago
Hi smedina1 ,
add a index column in PowerQuery Editor -> colse and apply.
and new a calculated column:
Repetido = CALCULATE( COUNTROWS('Table'), 'Table'[Client] = EARLIER('Table'[Client]) && 'Table'[Folder] = EARLIER('Table'[Folder]) && 'Table'[Index] <= EARLIER('Table'[Index]) )The PBIX file is attached for reference.
Best Regards,
Gao
Community Support TeamIf there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data
2 Replies
- AnonymousNot applicable
Hi smedina1 ,
add a index column in PowerQuery Editor -> colse and apply.
and new a calculated column:
Repetido = CALCULATE( COUNTROWS('Table'), 'Table'[Client] = EARLIER('Table'[Client]) && 'Table'[Folder] = EARLIER('Table'[Folder]) && 'Table'[Index] <= EARLIER('Table'[Index]) )The PBIX file is attached for reference.
Best Regards,
Gao
Community Support TeamIf there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data
- CristiánNew Member
Hola,
No hubo caso ingresar la formula a PQuery asi que intenté otra cosa y me funcinó:
Usé el Modelo de Datos de PIVOT para que me aparezca la opción "Recuento Distinto"
entonces:
en Campos de Tabla Dinámica, click derecho sobre el nombre de la tabla, y agragar medida
"=[Recuento de Folder]-[Recuento Distinto de Folder]"
Es importante que cuando insertes la Tabla Dinámica rellenes la casilla "agregar al Modelo de Datos". De esta manera aparecerá la Opción "Recuento Distinto"
Vé si el resultado es el deseado... a mi me sirve cuando al sistema le dan los Taldos y duplica ingresos.