Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!
I am trying to create a measure that counts the number of records that meet certain criteria, my SQL query returns the correct value but when I tried to convert that into DAX logic it seems to be counting all records and ignoring the filters I've included.
SQL Query:
Select Count(AUM_SITE_ID)
From Collector.Collector.GEOHAZARDS_AUM_SITE_INVENTORY Inventory
Where Status = 'A' and INSPECTION_DUE = 0
Result from this query is 3.
DAX code:
AUM Inspection Due = CALCULATE(
COUNT('AUM'[AUM_SITE_ID]),
'AUM'[INSPECTION_DUE] = 0,
'AUM'[STATUS] = "A"
)
Result from this code is 1968.
Thanks for the help!
Solved! Go to Solution.
@Anonymous , need some sample data to test.
Try this measure
AUM Inspection Due = CALCULATE(
COUNT('AUM'[AUM_SITE_ID]),
filter('AUM', not(isblank('AUM'[INSPECTION_DUE])) && 'AUM'[INSPECTION_DUE] = 0 &&
'AUM'[STATUS] = "A"
))
Hi @Anonymous
Your DAX works fine with my sample data.
Can you provide your data, can't test properly without it.
Regards
Phil
Proud to be a Super User!
@Anonymous , need some sample data to test.
Try this measure
AUM Inspection Due = CALCULATE(
COUNT('AUM'[AUM_SITE_ID]),
filter('AUM', not(isblank('AUM'[INSPECTION_DUE])) && 'AUM'[INSPECTION_DUE] = 0 &&
'AUM'[STATUS] = "A"
))
This worked perfectly, thank you!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 59 | |
| 59 | |
| 45 | |
| 17 | |
| 17 |
| User | Count |
|---|---|
| 115 | |
| 112 | |
| 38 | |
| 35 | |
| 26 |