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
Hello! I am looking to create a column in my table to create a personalized filter.
I am wanting to create a column that is basically "if this cell contains x, y, and z, print Unit"
This is what I wrote... but it isn't working right now. Just not sure how to create this formula.
Solved! Go to Solution.
I tried that... but it didn't work. My data that I'm pulling from looks like this:
January TMMWV TNGA
So I need to pull if that line has TMMWV, print Unit.
Thanks again!
Try this:
Type of Plant =
SWITCH (
TRUE,
CONTAINSSTRING ( Merge1[Plant and Line], "TMMAL" )
|| CONTAINSSTRING ( Merge1[Plant and Line], "TMMK PWT" )
|| CONTAINSSTRING ( Merge1[Plant and Line], "TMMWV" ), "Unit",
CONTAINSSTRING ( Merge1[Plant and Line], "TMMBC" )
|| CONTAINSSTRING ( Merge1[Plant and Line], "TMMI" )
|| CONTAINSSTRING ( Merge1[Plant and Line], "TMMK" )
|| CONTAINSSTRING ( Merge1[Plant and Line], "TMMC" )
|| CONTAINSSTRING ( Merge1[Plant and Line], "TMMGT" )
|| CONTAINSSTRING ( Merge1[Plant and Line], "TMMTX" ), "Vehicle",
"NEED TO INCLUDE"
)
Proud to be a Super User!
Try this calculated column:
Type of Plant =
SWITCH (
TRUE,
Merge1[Plant and Line] IN { "TMMAL", "TMMK PWT", "TMMWV" }, "Unit",
Merge1[Plant and Line] IN { "TMMBC", "TMMI", "TMMK", "TMMC", "TMMGT", "TMMTX" }, "Vehicle",
"NEED TO INCLUDE"
)
Proud to be a Super User!
I tried that... but it didn't work. My data that I'm pulling from looks like this:
January TMMWV TNGA
So I need to pull if that line has TMMWV, print Unit.
Thanks again!
Try this:
Type of Plant =
SWITCH (
TRUE,
CONTAINSSTRING ( Merge1[Plant and Line], "TMMAL" )
|| CONTAINSSTRING ( Merge1[Plant and Line], "TMMK PWT" )
|| CONTAINSSTRING ( Merge1[Plant and Line], "TMMWV" ), "Unit",
CONTAINSSTRING ( Merge1[Plant and Line], "TMMBC" )
|| CONTAINSSTRING ( Merge1[Plant and Line], "TMMI" )
|| CONTAINSSTRING ( Merge1[Plant and Line], "TMMK" )
|| CONTAINSSTRING ( Merge1[Plant and Line], "TMMC" )
|| CONTAINSSTRING ( Merge1[Plant and Line], "TMMGT" )
|| CONTAINSSTRING ( Merge1[Plant and Line], "TMMTX" ), "Vehicle",
"NEED TO INCLUDE"
)
Proud to be a Super User!
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 59 | |
| 43 | |
| 42 | |
| 23 | |
| 17 |
| User | Count |
|---|---|
| 190 | |
| 122 | |
| 96 | |
| 66 | |
| 47 |