Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
sagidam
Frequent Visitor

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 )

1 ACCEPTED SOLUTION
Anonymous
Not applicable

@sagidam,

 

Please use following formula for measures:

 

Count row := CALCULATE(COUNTROWS(Table3))

Then you will have this table:

 

1.PNG 

 

 

View solution in original post

7 REPLIES 7
MFelix
Super User
Super User

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

Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



its also give me the same resualt

Hi @sagidam,

Could you please tell me if your problem has been solved? If it is, could you please mark the helpful replies as Answered?

 

Regards,

Daniel He

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @sagidam,

 

What do you mean by same result?

 

Regards,

MFelix


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Thank you, its working
Anonymous
Not applicable

@sagidam,

 

Please use following formula for measures:

 

Count row := CALCULATE(COUNTROWS(Table3))

Then you will have this table:

 

1.PNG 

 

 

sorry its give me the same resualt

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.