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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
ivanvera79
New Member

COMO SUMAR EL TOTAL DE UN RECUENTO DISTINTO

Hola Amigos! queria pedir ayuda para poder solucionar en DAX el siguiente problema. Tengo una tabla con los campos conductores, con su ID y el campo fecha que muestra "la fecha en que presto servicio" dicho conductor

ivanvera79_0-1621728763063.png

Para poder calcular los dias trabajados utilizo la siguente formula que funciona bien, pero con un detalle. Necesito poder sumar los recuentos distintos de cada chofer y que aparezca en el total del campo. 

 

ivanvera79_1-1621728908533.pngEsta medida recuenta las fechas disntitas de la tabla

ivanvera79_2-1621728963259.png

Como veran el resultado del DISTINC COUNT a nivel de filas funciona bien, pero en el total necesito que sume la cantidad de dias totales de todos los choferes para devolver 43 en vez de 16 dias. 

¿COMO PUEDO SOLUCIONARLO?

desde ya muchas gracias!

1 REPLY 1
AlB
Super User
Super User

Hi @ivanvera79 

 

Measure =
SUMX ( DISTINCT ( TMS[Conductor1] ), CALCULATE ( TMS[Fin Real] ) )

 

SU18_powerbi_badge

Please accept the solution when done and consider giving a thumbs up if posts are helpful. 

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors