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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
smedina1
Frequent Visitor

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:

Repetido.JPG

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @smedina1 ,

add a index column in PowerQuery Editor -> colse and apply.

vcgaomsft_0-1666922722547.png

and new a calculated column:

Repetido = 
CALCULATE(
    COUNTROWS('Table'),
        'Table'[Client] = EARLIER('Table'[Client])
            && 'Table'[Folder] = EARLIER('Table'[Folder])
            && 'Table'[Index] <= EARLIER('Table'[Index])
)

vcgaomsft_1-1666923002626.png

The PBIX file is attached for reference.

 

Best Regards,
Gao

Community Support Team

 

If 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

View solution in original post

2 REPLIES 2
Cristián
New 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.

Anonymous
Not applicable

Hi @smedina1 ,

add a index column in PowerQuery Editor -> colse and apply.

vcgaomsft_0-1666922722547.png

and new a calculated column:

Repetido = 
CALCULATE(
    COUNTROWS('Table'),
        'Table'[Client] = EARLIER('Table'[Client])
            && 'Table'[Folder] = EARLIER('Table'[Folder])
            && 'Table'[Index] <= EARLIER('Table'[Index])
)

vcgaomsft_1-1666923002626.png

The PBIX file is attached for reference.

 

Best Regards,
Gao

Community Support Team

 

If 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

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors