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
Dali7
Frequent Visitor

Measure to count where value appears in another table and using a filter for containsstring

Hi there

 

I have produced the tables below based on dummy scenario that matches my actual data, I have two tables that are linked in many to many relationship under Technical Service:

 

Table 1 - all incidents

Technical ServiceTitleCreated by
Windows

Freeze

session

Joe Bloggs
AdobeFreeze unable to saveA Smith
Officeunable to saveP Jones

 

Table 2 - Type 1 incidents

Technical Service
Windows
Oracle
Office

 

The measure needs to count all the incidents under Table 1 by the created by column, in each row where the Technical Service in Table 1 is also contained within Table 2 Technical Service column. There then needs to be a filter for CONTAINSSTRING in Table 1 Title column for the word "Freeze".

 

This will then be used in a table visualisation looking something like this:

 

Created byCount of Freeze
Joe Bloggs1 (as Technical service appears in both tables and title contains the word Freeze
A Smith0 (as Adobe is not listed in Technical Service Table 2)
P Jones0 (as title does not contain the word Freeze)

 

I've been searching through the forum using LOOKUPVALUE and RELATED and can identify similar measures but they don't quite match what I am looking for and can't amend them correctly to fit my example.

 

Many thanks for any help you can provide.

1 ACCEPTED SOLUTION
bhanu_gautam
Super User
Super User

@Dali7 , Ensure that there is a relationship between Table 1 and Table 2 based on the Technical Service column.

 

Then use DAX to create a measure that counts the incidents where the Technical Service in Table 1 is also in Table 2 and the Title contains the word "Freeze".

 

DAX
Count of Freeze =
CALCULATE(
COUNTROWS('Table 1'),
FILTER(
'Table 1',
'Table 1'[Technical Service] IN VALUES('Table 2'[Technical Service]) &&
CONTAINSSTRING('Table 1'[Title], "Freeze")
)
)




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






View solution in original post

2 REPLIES 2
bhanu_gautam
Super User
Super User

@Dali7 , Ensure that there is a relationship between Table 1 and Table 2 based on the Technical Service column.

 

Then use DAX to create a measure that counts the incidents where the Technical Service in Table 1 is also in Table 2 and the Title contains the word "Freeze".

 

DAX
Count of Freeze =
CALCULATE(
COUNTROWS('Table 1'),
FILTER(
'Table 1',
'Table 1'[Technical Service] IN VALUES('Table 2'[Technical Service]) &&
CONTAINSSTRING('Table 1'[Title], "Freeze")
)
)




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






@bhanu_gautam OMG thank you so much for such a quick response and it has worked perfectly, it was the IN VALUES that I wasn't familar with and that I was struggling with, thanks again.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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