Forum Discussion

Pbiuserr's avatar
Pbiuserr
Post Prodigy
4 years ago

COUNTROWS counting wrong

Hello, 

I have a table as a result of the drillthrough like down below 

 

IDCountryGenderSeniorityCompany
ID1COUNTRY1M Company1
ID2COUNTRY2F7Company2
ID3COUNTRY3F Company3
ID4COUNTRY4F Company4
ID5COUNTRY5M 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

  • Anonymous's avatar
    Anonymous
    Not 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. 

    • Pbiuserr's avatar
      Pbiuserr
      Post Prodigy

      Hey
      In reality my ids are just numbers, that was on purpose of dummy data

      • Anonymous's avatar
        Anonymous
        Not applicable

        Are you only trying to get count of how many ID rows are selected or any column in the table?

  • v-zhangti's avatar
    v-zhangti
    Community 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.

    • Pbiuserr's avatar
      Pbiuserr
      Post Prodigy

      Hi,

      I've done similarly to you - INT (COUNTROWS ( ALLSELECTED (FactTable) ) >= 10 )
      and in filters on visual took advanced filtering -> "is 1"

      • v-zhangti's avatar
        v-zhangti
        Community Support

        Hi, Pbiuserr 

         

        Not fully understood, what kind of results do you expect? Is it possible to show it in pictures?

         

        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.