Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Dear all,
I try to achieve a combination of Text.Contain statements, but I fail with that. I don't know where to look at, maybe you do have an idea.
I have got following structure in my table:
| Interface name | Error statement |
| Interface apple | There is a mismatch |
| Interface banana | There is a mismatch |
The relevant part of the statement looks like this:
if (Text.Contains(Error Statement], "There is a mismatch") and Text.Contains([Interface name] = "apple")) then "Result 1"
else if (Text.Contains(Error Statement], "There is a mismatch") and Text.Contains([Interface name] = "banana")) then "Result 2"
The error message which I receive is:
An error occurred in the ‘xxx’ query. Expression.Error: The field 'Interface name' of the record wasn't found.
Thank you in advance,
Tobias
Solved! Go to Solution.
I was able to create a new column for the specified condition with final else condition. Make sure to use the correct column names.
Let us know if this helps.
Hello together,
I managed to solve the issue.
The statement of @VasTg is correct!
In my special case, I had a formatting issue in the column, which I used for the second statement (Interface name). Although I used the Text.Contains function and only searched to a small part of the text, the query brought up errors.
Now I used another column containing similar information and here it works.
Anyone else having the same problem: Use the query how @VasTg buildt it. If you fail, first try to use another column to check, if the query is the problem or your data format.
Topic solved!
Thanks & regards,
Tobias
Thanks for you reply. This was only a copy&paste issue. I copied my original statement and replaced the values with some samples.
I was able to create a new column for the specified condition with final else condition. Make sure to use the correct column names.
Let us know if this helps.
@VasTg: Thanks your reply. In your screenshot I noticed something, which I was doing wrong: I used a "=" instead of a "," in the second statement. But still I receive this error message:
An error occurred in the ‘xxx’ query. Expression.Error: The field 'Interface name' of the record wasn't found.
One more information which I missed to provide: My if-else contains several loops. Only two of them are extended with an "and" clause.
Do you think Power BI might have an issue in this regard?
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 61 | |
| 44 | |
| 41 | |
| 36 | |
| 21 |
| User | Count |
|---|---|
| 175 | |
| 119 | |
| 106 | |
| 77 | |
| 50 |