Forum Discussion
Help with DAX
- 5 years ago
Hi Avivek,
Not sure why you have Blank() in Quotations, it is not a string but the equivalent of NULL, following should fix that issue.
Column = CALCULATE(DISTINCTCOUNT('SURGEON SALES'[ORDER_ID]),FILTER('SURGEON SALES','SURGEON SALES'[NPI]=BLANK()))However given that it looks like you are creating a column to count the following would be easier
Column = IF('SURGEON SALES'[NPI]=BLANK(), 1, blank())Better yet create a measure that counts the rows you are interested in
Blank ID = CALCLUATE(COUNTROWS('SURGEON SALES'), 'SURGEON SALES'[NPI]=BLANK())Hope this Helps,
Richard
Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!
Hi Avivek,
Let me try,
Your original formiula had Blank() in quotes, like "Blank()" so your formula was looking for the string "Blank()" not the value Blank() aka null.
Given that you are creating a calculated column and it will be evaluated in the context of the row there is no reason to perform a distinct count of the id, you simply need to check for the existince of the id and return a 1 or null, then count the results in a measure.
Hope that makes sense.
thankyou. I got it now🙂