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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Does Power BI have a COUNT function that counts values in more than one column?

Hi! I have a problem. I have the following type of table

Ava Bor Dop Col
--------------------
Ava        Dop
       Bor  Dop Col
Ava                 
       Bor  Dop

What I want is a horizontal bar chart whose vertical axis are the column headers above and the heights of the bars are the counts of each in the table.  In other words, a bar chart representing the summarized
Variable     COUNT
Ava             2
Bor             2
Dop            3
Col              1

Any help? 

1 ACCEPTED SOLUTION
MFelix
Super User
Super User

Hi @Anonymous ,

 

I would unpivot the columns and filter out the blanks and use it to create my char however if you have this setup you need to add 4 measures:

AVA Measure = CALCULATE(COUNT('Table'[AVA]);'Table'[AVA] <> "")
BOR Measure = CALCULATE(COUNT('Table'[AVA]);'Table'[BOR] <> "")
DOP Measure = CALCULATE(COUNT('Table'[AVA]);'Table'[DOP] <> "")
COL Measure = CALCULATE(COUNT('Table'[AVA]);'Table'[COL] <> "")

 

Then place then on the values of the Clustered bar chart.


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



View solution in original post

2 REPLIES 2
v-easonf-msft
Community Support
Community Support

Hi, @Anonymous 

You  can try function  "CountRows" as below:

Ava_measure = COUNTROWS(FILTER('Table','Table'[Ava]<>""))
Bor_measure = COUNTROWS(FILTER('Table','Table'[Bor]<>""))
Col_measure = COUNTROWS(FILTER('Table','Table'[Col]<>""))
Dop_measure = COUNTROWS(FILTER('Table','Table'[Dop]<>""))

You can aslo  use function "CountA", if your column  cell is "null"  rather than  "".

Ava_measure2 = COUNTA('Table (2)'[Ava])
Bor_measure2 = COUNTA('Table (2)'[Bor])
Col_measure2 = COUNTA('Table (2)'[Col])
Dop_measure2 = COUNTA('Table (2)'[Dop])

Please check the attached pbix for more details.

 

Best Regards,
Community Support Team _ Eason

 

MFelix
Super User
Super User

Hi @Anonymous ,

 

I would unpivot the columns and filter out the blanks and use it to create my char however if you have this setup you need to add 4 measures:

AVA Measure = CALCULATE(COUNT('Table'[AVA]);'Table'[AVA] <> "")
BOR Measure = CALCULATE(COUNT('Table'[AVA]);'Table'[BOR] <> "")
DOP Measure = CALCULATE(COUNT('Table'[AVA]);'Table'[DOP] <> "")
COL Measure = CALCULATE(COUNT('Table'[AVA]);'Table'[COL] <> "")

 

Then place then on the values of the Clustered bar chart.


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



Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors