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!Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.
I have this table with a field that contains data like this:
[9]
[9,19]
[19]
[4,9]
[9,17]
(and other values) Essentially it's square brackets [] with numbers in between them.
I need to find all the ones that have just 9. And I originally created the new column in Power BI like this:
Solved! Go to Solution.
Please try
COPC =
VAR String =
SUBSTITUTE ( SUBSTITUTE ( Admissions[TypeIds], "[", "" ), "]", "" )
VAR Items =
SUBSTITUTE ( String, ",", "|" )
VAR Length =
COALESCE ( PATHLENGTH ( Items ), 1 )
VAR T =
GENERATESERIES ( 1, Length, 1 )
RETURN
IF (
"9" IN SELECTCOLUMNS ( T, "@Item", PATHITEM ( Items, [Value] ) ),
"Yes",
"No"
)
@Thomas_MedOne
I've made sample file to test the proposed solution. Please refer to attached
COPC =
VAR String =
SUBSTITUTE ( SUBSTITUTE ( Admissions[TypeIds], "[", "" ), "]", "" )
VAR Items =
SUBSTITUTE ( String, ",", "|" )
VAR Length =
COALESCE ( PATHLENGTH ( Items ), 1 )
VAR T =
GENERATESERIES ( 1, Length, 1 )
RETURN
IF (
"9" IN SELECTCOLUMNS ( T, "@Item", PATHITEM ( Items, [Value] ) ),
"Yes",
"No"
)
@Thomas_MedOne
I've made sample file to test the proposed solution. Please refer to attached
COPC =
VAR String =
SUBSTITUTE ( SUBSTITUTE ( Admissions[TypeIds], "[", "" ), "]", "" )
VAR Items =
SUBSTITUTE ( String, ",", "|" )
VAR Length =
COALESCE ( PATHLENGTH ( Items ), 1 )
VAR T =
GENERATESERIES ( 1, Length, 1 )
RETURN
IF (
"9" IN SELECTCOLUMNS ( T, "@Item", PATHITEM ( Items, [Value] ) ),
"Yes",
"No"
)
That is amazing, I would have never been able to figure that out. Thank you.
Sorry I was not clear. I need all of the 9's so It also has to match like [4,9] and [9,17] and even [9,19]
Please try
COPC =
VAR String =
SUBSTITUTE ( SUBSTITUTE ( Admissions[TypeIds], "[", "" ), "]", "" )
VAR Items =
SUBSTITUTE ( String, ",", "|" )
VAR Length =
COALESCE ( PATHLENGTH ( Items ), 1 )
VAR T =
GENERATESERIES ( 1, Length, 1 )
RETURN
IF (
"9" IN SELECTCOLUMNS ( T, "@Item", PATHITEM ( Items, [Value] ) ),
"Yes",
"No"
)
If just 9 as you have mentioned, then please try
COPC = IF ( Admissions[TypeIds] = "[9]", "Yes", "No" )
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the September 2025 Power BI update to learn about new features.
User | Count |
---|---|
9 | |
8 | |
6 | |
4 | |
3 |