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

Top Solution Authors