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

Counting rows by searching text in one column and value in another column of a table

Hello

I have a table one column has Comments (free text) and another column has a value. I'm trying to count the rows that contain the "Warranty" in any part of the text in Comments column and in the Totals column the value 0

 

eg

[Comments]                                                       [ Total]

Checked engine                                                $500

Service may have warranty                               $100

Warranty repair                                                 $0

 

Im looking for a solution of 1 which is the 3rd row as it has the word warranty and the value 0

 

Thanks in advance

2 REPLIES 2
gctaeger
New Member

Hello - thanks for your response but the dax formula summed the value i.e. I got a result of $481.80 which was the value of 1 invoice which had the term warranty in the [comments] - I did a manual check and there were 3 invices with the term warranty 2 had values and 1 had $0.00. the solution should give a result of 1 i.e. 1 row which has $0.00 value and the term warranty

I'm new to DAX

Thanks once again very much appreciated

amitchandak
Super User
Super User

@gctaeger , based on what I got. Try a measure like

calculate(sum(table[total]), filter(Table, search("warranty",[Comments],,0)>0))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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.