Power Pivot - Distinct Count - Blanks

Sekushio

New Member
Joined
Oct 13, 2015
Messages
5
I am having some issues getting the formula right to Distinct Count a column without counting the blank.

Distinct Count of Tech 2:=DISTINCTCOUNT([Tech])
-works but counts the blanks as 1 as well (there will not always be a blank)

Distinct Count of Tech 3:=CALCULATE([Distinct Count of Tech 2], not(isBLANK([Tech])))
-Semantic Error: The value for 'Tech' cannot be determined. Either 'Tech' doesn't exist, or there is no current row for a column named 'Tech'.

Distinct Count of Tech 5:=CALCULATE(DISTINCTCOUNT([Tech]),FILTER(NOT(ISBLANK([Tech]))))
-Semantic Error: Too few arguments were passed to the FILTER function. The minimum argument count for the function is 2.

Example of Column

Tech
2161
2161
2158
1703
2159

2159
1703

2161

2159
1703
1722

The first would tell me there are 6 unique techs working when there are only 5, because its counting the blank.

I am hoping I am just making a silly mistake and this can be done, and that what I learn from this can be applied to counts in other columns when wanting to only count a specific item.
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
Hi there,

Your second formula should work if you qualify [Tech] with its table name, e.g. MyTable[Tech].
Always best practice to do this and in this case it's necessary for [Tech] to be recognized as a column.

Code:
[COLOR=#333333]Distinct Count of Tech 3:=CALCULATE([Distinct Count of Tech 2], NOT(ISBLANK(MyTable[Tech]) ) )
[/COLOR]
 
Upvote 0
Thank you, but curious if I can do it without table name, as they are sheets with no tables. Would I put in the sheet name?
 
Upvote 0
Anyone know if this is doable w/o a table? The amount of information being pulled in is a bit much and would rather it just use the sheet.
 
Upvote 0
Can you clarify what do you mean by "without a table"?
From your original question, you have a table in your data model with the column Tech don't you?
 
Upvote 0
I'm sorry if it looks like that, but I do not have a table on the page I am using the Power Pivot on. It is a whole sheet and the rows are over 3000 with about 50 columns from its source. I may be doing it all wrong, but that is how I have it at the moment, unless the sheet is considered the table. Sorry if there is some confusion, I'm just getting into this excel thing.
 
Upvote 0
So my sheet slapped me in the face this morning and I realize now that its a table (just looks like a sheet to me) and that its name is range and was created that way when I had hit power pivot. Lessoned learned..... however now that I have corrected the formula, no longer gives an error, but still counts the blank. Hopefully before lunch I'll have figured out how to right the correct formula. Thanks for responding earlier, it made me continue to question what I am doing.
 
Upvote 0

Forum statistics

Threads
1,224,126
Messages
6,176,519
Members
452,733
Latest member
Gao87

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top