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
rigreen
Microsoft Employee
Microsoft Employee

Count row if cell contains text from another column table

I have a data source where the column value of "errors" contains multiple error codes "EID01;EID03;EID04" etc. I have a seperate table with a column of the error codes. I'm trying to write a measure that will allow for a table to display all error codes and the count of codes within the "error" column. Simplified desired output below using a table visual.

 

Error CodesCount of Errors
EID0145
EID0213
EID035
2 ACCEPTED SOLUTIONS
Anonymous
Not applicable

Hi @rigreen ,

 

Suppose we have a table like this:

vcgaomsft_0-1663293171850.png

Split column in Power Query Editor:

vcgaomsft_1-1663293284064.png

Unpivot columns - > remove [attribute] column -> rename [value] column - close and apply:

vcgaomsft_3-1663293407866.png

Relationships:

vcgaomsft_4-1663293619374.png

Result:

vcgaomsft_5-1663293666744.png

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly -- How to provide sample data

View solution in original post

tamerj1
Super User
Super User

Hi @rigreen 
Please try

Count of Errors =
COUNTROWS (
    FILTER (
        Table1,
        CONTAINSSTRING ( Table1[errors], MAX ( Table2[Error Codes] ) )
    )
)

View solution in original post

4 REPLIES 4
tamerj1
Super User
Super User

Hi @rigreen 
Please try

Count of Errors =
COUNTROWS (
    FILTER (
        Table1,
        CONTAINSSTRING ( Table1[errors], MAX ( Table2[Error Codes] ) )
    )
)
rigreen
Microsoft Employee
Microsoft Employee

Your solution worked and is also the one that I'm using. It won't let me switch it as the accepted solution. If I figure it out i'll change it back. Thank you!

Anonymous
Not applicable

Hi @rigreen ,

 

Suppose we have a table like this:

vcgaomsft_0-1663293171850.png

Split column in Power Query Editor:

vcgaomsft_1-1663293284064.png

Unpivot columns - > remove [attribute] column -> rename [value] column - close and apply:

vcgaomsft_3-1663293407866.png

Relationships:

vcgaomsft_4-1663293619374.png

Result:

vcgaomsft_5-1663293666744.png

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly -- How to provide sample data

rigreen
Microsoft Employee
Microsoft Employee

I should clarify, the rows in the column "errors" have multiple error codes per cell. 

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.