Forum Discussion

sagidam's avatar
sagidam
Frequent Visitor
7 years ago
Solved

DAX COUNT/COUNTA filtered by columns

Hello friends,
I try to find from the table the numbers of row by company name ( i have more then 100 companies), 
When I want to be filtered by field By compname,
Example of a table "BALL"

id

compname

ballance

1

A

26

1

B

15

2

B

9

2

A

15

3

B

5

3

A

3

6

B

434

 

In this example the result will be

A=3 (numbers A rows)

B=4 (number B rows )

  • Anonymous's avatar
    Anonymous
    7 years ago

    sagidam,

     

    Please use following formula for measures:

     

    Count row := CALCULATE(COUNTROWS(Table3))

    Then you will have this table:

     

     

     

     

7 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    sagidam,

     

    Please use following formula for measures:

     

    Count row := CALCULATE(COUNTROWS(Table3))

    Then you will have this table:

     

     

     

     

    • sagidam's avatar
      sagidam
      Frequent Visitor

      sorry its give me the same resualt

  • Hi sagidam,

    If you add the colum company to a visual and then balance or ID and select the option count it will give the expected result.

    However if you need a measure in dax you can use

    Count companie = COUNTA(BALL[compname])

    Then selecting the the companie column will give you context to count the number of rows.

    Regards,
    MFelix
    • sagidam's avatar
      sagidam
      Frequent Visitor

      its also give me the same resualt

      • MFelix's avatar
        MFelix
        Icon for Super User rankSuper User

        Hi sagidam,

         

        What do you mean by same result?

         

        Regards,

        MFelix