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
Anonymous
Not applicable

Cuenta cero pero no en blanco

Hola a todos,

He creado una medida en la que cuento todas las ventas que se han vendido con 0 de descuento. Pero mi problema es que también cuenta todos los campos en blanco en la columna específica. A continuación se muestra mi medida:

Medida: CALCULATE([Total Sales], Ventas[Descuento] - 0)

Cuando escribo 0 entonces se necesita 0 Y en blanco. ¿Cómo puedo contar todos los 0 de la columna "Descuento" pero no incluir campos en blanco?

1 ACCEPTED SOLUTION
MFelix
Super User
Super User

Hola @seryil ,

Usted debe utilizar el signo estrictamente igual , por lo que su medida debe ser:

Measure = CALCULATE([Total Sales], Sales[Discount] == 0)

compruebe la explicación en el siguiente enlace:

https://dax.guide/op/strictly-equal-to/-:text-Strictly%20equal%20to%20(%3D%3D)%20DAX%20Operator,any%....


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@seryil , Probar

CALCULATE([Total Sales], Filter(Sales,not(isblank(Sales[Discount] )) && Sales[Discount] ? 0))

CALCULATE([Total Sales], coalesce(Ventas[Descuento],-1) á 0)

MFelix
Super User
Super User

Hola @seryil ,

Usted debe utilizar el signo estrictamente igual , por lo que su medida debe ser:

Measure = CALCULATE([Total Sales], Sales[Discount] == 0)

compruebe la explicación en el siguiente enlace:

https://dax.guide/op/strictly-equal-to/-:text-Strictly%20equal%20to%20(%3D%3D)%20DAX%20Operator,any%....


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



AllisonKennedy
Super User
Super User

Prueba contarro en tu mesa de hechos. utilice FILTER para filtrar la tabla de hechos para [Descuento] <> BLANK() y, a continuación, contar ceros.

Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

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.