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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
n2p2gupta
Frequent Visitor

Power BI - how to count across row in multiple columns

Tabel example:

 

A  B  C  D  E  F      Total

1  0   0  0  0  0         1

1  1   1  1  0  0         4

0  0   0  0  1  1         2

0  0   0  0  0  0         0

 

Can you please help and provide an example how to count the value in column "Total" using DAX.  Thx.

1 ACCEPTED SOLUTION
Eric_Zhang
Microsoft Employee
Microsoft Employee

@n2p2gupta

totalA = Table1[A]+Table1[B]+Table1[C]+Table1[D]+Table1[E]+Table1[F]

or you'd like to count the non-0s
totalB = IF([A]=0,0,1)+IF([B]=0,0,1)+IF([C]=0,0,1)+IF([D]=0,0,1)+IF([E]=0,0,1)+IF([F]=0,0,1)

Capture.PNG

View solution in original post

1 REPLY 1
Eric_Zhang
Microsoft Employee
Microsoft Employee

@n2p2gupta

totalA = Table1[A]+Table1[B]+Table1[C]+Table1[D]+Table1[E]+Table1[F]

or you'd like to count the non-0s
totalB = IF([A]=0,0,1)+IF([B]=0,0,1)+IF([C]=0,0,1)+IF([D]=0,0,1)+IF([E]=0,0,1)+IF([F]=0,0,1)

Capture.PNG

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.