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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
njxfoster
Helper I
Helper I

How to If text column CONTAINS specified value, Then Count it

Hi Everyone,

 

I'm trying to create a calculated measure in one of my tables that help me count every column that contains the word "Warm".

 

How can I implement CALCULATE(COUNTROWS to achieve this function? 

 

 

Thank you

1 ACCEPTED SOLUTION

Hi @njxfoster 

 

Try this measure:

Measure =
CALCULATE (
    COUNTROWS ( 'Table' ),
    FILTER ( 'Table', CONTAINSSTRING ( 'Table'[Connection Details], "Warm" ) )
)

 

 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: 
www.linkedin.com/in/vahid-dm/

 

 

View solution in original post

3 REPLIES 3
ValtteriN
Super User
Super User

Hi,

Here is one way to do this:

CountWarm = COUNTROWS(
FILTER(
ADDCOLUMNS(Temperature,"Test",
if(SEARCH("Warm",Temperature[Temperature],,2)<>2,1,0)),[Test]=1))


End result:
ValtteriN_0-1642623635705.png

I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!







Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Hi ValtteriN! Thank you for your answer

 

The table is for phone transfer detail, There is a column about "Connection Details". I need to see how many phone connection is being " Warm transfered"  So I was thinking to count columns that contain the word "Warm" .

 

is there any way to count this without creating new column?

 

Thanks in advance

Hi @njxfoster 

 

Try this measure:

Measure =
CALCULATE (
    COUNTROWS ( 'Table' ),
    FILTER ( 'Table', CONTAINSSTRING ( 'Table'[Connection Details], "Warm" ) )
)

 

 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: 
www.linkedin.com/in/vahid-dm/

 

 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.