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
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
Employee
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
Employee
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
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.