Forum Discussion
COUNTROWS counting wrong
Hello,
I have a table as a result of the drillthrough like down below
| ID | Country | Gender | Seniority | Company |
| ID1 | COUNTRY1 | M | Company1 | |
| ID2 | COUNTRY2 | F | 7 | Company2 |
| ID3 | COUNTRY3 | F | Company3 | |
| ID4 | COUNTRY4 | F | Company4 | |
| ID5 | COUNTRY5 | M | Company5 |
ID and Seniority is from one table (Table1 lets call it), rest are from dimension tables.
My formula COUNTROWS (ALLSELECTED (Table1) ) gives me result of 1 (I assume because of Seniority)
I tried to do the trick and copy the table, change visual to a card and count distinct, but it also insists that card will be Seniority and also gives count of 1.
Whats the way to count only visible ID in this table?
7 Replies
- AnonymousNot applicable
I believe you could duplicate the ID column, extract the first 2 letters & you will be left with just the numbers. Then try COUNTROWS on that column. It might be getting stuck on ID being at the beginning of every value & considering them all the same. Try that and let me know.
- PbiuserrPost Prodigy
Hey
In reality my ids are just numbers, that was on purpose of dummy data- AnonymousNot applicable
Are you only trying to get count of how many ID rows are selected or any column in the table?
- v-zhangtiCommunity Support
Hi, Pbiuserr
Please check the following methods.
Count = COUNTROWS (ALLSELECTED('Table 1'[ID]))Is this the result you expect?
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- PbiuserrPost Prodigy
Hi,
I've done similarly to you - INT (COUNTROWS ( ALLSELECTED (FactTable) ) >= 10 )
and in filters on visual took advanced filtering -> "is 1"