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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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))

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors