Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request 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 @Anonymous, 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 @Anonymous ,
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 @Anonymous ,
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 @Anonymous, 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 @Anonymous
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
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 97 | |
| 73 | |
| 50 | |
| 46 | |
| 44 |