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!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
Hello community,
I have a table like the example below.
I would like to add the code if any column in STRING contains the text "AAA"
CODE | STRING | Expected Result |
111 | xxxxAAAxxx | 111 |
111 | xxxxxxxxxxx | 111 |
111 | xxxxxxxxxxx | 111 |
222 | xxxxxxxxxxx | |
222 | xxxxxxxxxxx | |
222 | xxxxxxxxxxx | |
333 | xxxxxxxxxxxx | 333 |
333 | xxxxAAAxxx | 333 |
I know it's quite confuse but your help would be very appreciated.
Thank you very much,
Simao
Solved! Go to Solution.
Try this calculated column:
Code with AAA =
VAR vCode = Table1[CODE]
VAR vTable =
FILTER (
Table1,
Table1[CODE] = vCode
&& CONTAINSSTRING ( Table1[STRING], "AAA" )
)
VAR vResult =
IF ( ISEMPTY ( vTable ), BLANK (), vCode )
RETURN
vResult
Proud to be a Super User!
Thak you very much! It's Perfect
Try this calculated column:
Code with AAA =
VAR vCode = Table1[CODE]
VAR vTable =
FILTER (
Table1,
Table1[CODE] = vCode
&& CONTAINSSTRING ( Table1[STRING], "AAA" )
)
VAR vResult =
IF ( ISEMPTY ( vTable ), BLANK (), vCode )
RETURN
vResult
Proud to be a Super User!
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.