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!Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.
Hi,
I need a measure to calculate with conditions that
Count: Internal Site ID
Condition 1: Category = NDPd
Condition 2: Site Creation(NDPd/IPM) = blank
Result= 23
My try is below and not resulting 23. still showing 32,561 total count of Internal Site ID.
Pls fix and suggest any simpler and better measure.
Solved! Go to Solution.
Hi @jeongkim, Please try the below measure:
NDPd Site Creation =
CALCULATE(
COUNTROWS('Distinct - Master Data'),
'Distinct - Master Data'[Category] = "NDPd",
ISBLANK('Distinct - Master Data'[Site Creation(NDPd/IPM)])
)
Hi @jeongkim ,
You can achieve your goal by this DAX:
NDPd Site Creation =
VAR _filter =
FILTER(
'Distinct - Master Data',
'Distinct - Master Data'[Category] = "NDPd" &&
ISBLANK('Distinct - Master Data'[Site Creation(NDPd/IPM)])
)
RETURN
CALCULATE(
COUNT('Distinct - Master Data'[Internal Site ID]),
_filter
)
Here you go
VAR _filter =
FILTER (
'Distinct - Master Data',
'Distinct - Master Data'[Category] = "NDPd"
&& ISBLANK ( 'Distinct - Master Data'[Site Creation(NDPd/IPM)] )
)
RETURN
CALCULATE ( COUNTROWS ( 'Distinct - Master Data' ), _filter )
COUNTROWS - counts the number of rows in a table
COUNT - Counts the number of rows in the table where the specified column has a non-blank value
if there are no blanks in Internal Site ID column, the result will be the same
Hi @jeongkim ,
You can achieve your goal by this DAX:
NDPd Site Creation =
VAR _filter =
FILTER(
'Distinct - Master Data',
'Distinct - Master Data'[Category] = "NDPd" &&
ISBLANK('Distinct - Master Data'[Site Creation(NDPd/IPM)])
)
RETURN
CALCULATE(
COUNT('Distinct - Master Data'[Internal Site ID]),
_filter
)
This solution also works thanks!
Hi @jeongkim, Please try the below measure:
NDPd Site Creation =
CALCULATE(
COUNTROWS('Distinct - Master Data'),
'Distinct - Master Data'[Category] = "NDPd",
ISBLANK('Distinct - Master Data'[Site Creation(NDPd/IPM)])
)
It works thanks!
Hi @jeongkim
To achieve a distinct count filtered by _filter in DAX using CALCULATE, you must use the complete expression defined in the variable, rather than the variable itself. DAX variables are immutable. Once they're assigned a value, they cannot be altered or reassigned within the same expression.
any new dax suggestion pls?
Just use the expression from the _count variable in CALCULATE after your RETURN statement.
I dont' get it, can you write the code?
Here you go
VAR _filter =
FILTER (
'Distinct - Master Data',
'Distinct - Master Data'[Category] = "NDPd"
&& ISBLANK ( 'Distinct - Master Data'[Site Creation(NDPd/IPM)] )
)
RETURN
CALCULATE ( COUNTROWS ( 'Distinct - Master Data' ), _filter )
COUNTROWS - counts the number of rows in a table
COUNT - Counts the number of rows in the table where the specified column has a non-blank value
if there are no blanks in Internal Site ID column, the result will be the same
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the September 2025 Power BI update to learn about new features.