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
PMorfitt
New Member

How to count a text value in multiple columns for each row

Hi All,

 

i have a set of data which has the following:

 

Products with unique identifier. Each product should have a set of documents. The data set i have has gaps with which documents are avalible for the product. I would like to visually show number of missing documents as well as which documents are avaliable. 

Product CodeProduct NameDoc Type
1234ApplePaper
1234AppleInk
1234ApplePen
4321BananaPaper
4321BananaPen
2345PearShrink Wrap 

 

So what i did was created a list from column 'doc type', so the unique count of the product and created custom columns using the following formula: Added contitional column, , each if text.contains ( ) then true else false) ,to give a true/false indication if a certain document is there or not. 

 

Product CodeProduct NameDoc Type.ListConditional column.PaperConditional column.Shrink WrapConditional column. Pen
1234ApplePaper, Shrink Wrap, PenTrueTrueTrue
4321Banana Pen, PaperTrueFalseTrue
2345PearShrink WrapFalseTrueFalse

 

What i would like to do is count the number of 'False' across the conditional column for each row. 

 

Can someone help?

 

Thank you in advance. 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @PMorfitt ,

 

Please create a calculated column as below.

 

Column = IF('Table'[Conditional column.Paper]="false",1,0)+IF('Table'[Conditional column. Pen]="false",1,0)+IF('Table'[Conditional column.Shrink Wrap]="false",1,0)

 

3.PNG 

 

Best Regards,

Jay

Community Support Team _ Jay Wang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @PMorfitt ,

 

Please create a calculated column as below.

 

Column = IF('Table'[Conditional column.Paper]="false",1,0)+IF('Table'[Conditional column. Pen]="false",1,0)+IF('Table'[Conditional column.Shrink Wrap]="false",1,0)

 

3.PNG 

 

Best Regards,

Jay

Community Support Team _ Jay Wang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

VasTg
Memorable Member
Memorable Member

@PMorfitt 

 

You could add a custom column to get the count of False as below

 

=Number.Abs((Number.From([Conditional column.Paper])-1)+(Number.From([Conditional column.Shrink Wrap])-1)+(Number.From([Conditional column. Pen])-1))

 

image.png

 

If it helps, mark it as a solution

Kudos are nice too

Connect on LinkedIn

@VasTgThank you for sharing, i've tried as you've suggested however i recieved an error message:

 

Expression.Error: We cannot apply operator - to types Logical and Number.
Details:
Operator=-
Left=FALSE
Right=1

 

do you mind explaining what this means and how i can adapt the formula you've provided? 

Thanks

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.