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

Fórmula Dax que devuelve valores diferentes de la consulta SQL

Estoy tratando de crear una medida que cuenta el número de registros que cumplen ciertos criterios, mi consulta SQL devuelve el valor correcto, pero cuando intenté convertir eso en lógica DAX parece estar contando todos los registros e ignorando los filtros que he incluido.

Consulta SQL:

Select	Count(AUM_SITE_ID)
From Collector.Collector.GEOHAZARDS_AUM_SITE_INVENTORY Inventory
Where Status = 'A' and INSPECTION_DUE = 0

El resultado de esta consulta es 3.

Código DAX:

AUM Inspection Due = CALCULATE(
                    COUNT('AUM'[AUM_SITE_ID]),
                    'AUM'[INSPECTION_DUE] = 0,
                    'AUM'[STATUS] = "A"
)

El resultado de este código es 1968.

¡Gracias por la ayuda!

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@rtolbert , necesita algunos datos de ejemplo para probar.

Prueba esta medida

Inspección de AUM debida: CALCULATE(
COUNT('AUM'[AUM_SITE_ID]),
filter('AUM', not(isblank('AUM'[INSPECTION_DUE])) && 'AUM'[INSPECTION_DUE] á 0 &&
'AUM'[STATUS] á "A"
))

View solution in original post

3 REPLIES 3
PhilipTreacy
Super User
Super User

No @rtolbert

Su DAX funciona bien con mis datos de muestra.

Puede proporcionar sus datos, no puede probar correctamente sin ellos.

saludos

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


amitchandak
Super User
Super User

@rtolbert , necesita algunos datos de ejemplo para probar.

Prueba esta medida

Inspección de AUM debida: CALCULATE(
COUNT('AUM'[AUM_SITE_ID]),
filter('AUM', not(isblank('AUM'[INSPECTION_DUE])) && 'AUM'[INSPECTION_DUE] á 0 &&
'AUM'[STATUS] á "A"
))

Anonymous
Not applicable

Esto funcionó perfectamente, gracias!

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.