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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
asc002
Frequent Visitor

How to count how many times a word appears in another column from another table

HI

I have two tables like following: 

 

TABLE 1

case notitle
1245hchdca ads sdposdjg bcd
13446spvsdhsdphsd ads hgkèhg
56784sdfshpsdsd ads èrhrèr

 

TABLE 2:

wordcount
ads? -> the answer should be 3
bcd? -> the answer should be 1

 

there is not relationship between the two tables.

How can I count how many times the value in the "word" column is present into the table 1 column "title"?

 

thanks for your ideas

Andrea

3 REPLIES 3
asc002
Frequent Visitor

HI

thanks. what about if I would like to have it as measure?

 

thanks

Andrea

Hi,

Thank you for your message, and please check the below picture and the attached pbix file.

It is for creating a new measure.

 

Picture1.png

 

Count measure: =
IF (
    HASONEVALUE ( 'Table 2'[word] ),
    COUNTROWS (
        FILTER (
            'Table 1',
            CONTAINSSTRING ( 'Table 1'[title], MAX ( 'Table 2'[word] ) )
        )
    )
)

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.
Jihwan_Kim
Super User
Super User

Hi,

Please check the below.

It is for creating a new column.

 

Picture1.png

 

Count CC = 
COUNTROWS (
    FILTER ( 'Table 1', CONTAINSSTRING ( 'Table 1'[title], 'Table 2'[word] ) )
)

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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.

Top Solution Authors
Top Kudoed Authors