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 Everyone,
I would like to add a category column based on an existing text column in my table. I have the text column as shown below, and I have provided the desired result that I aim to achieve:
Text Column:
| Title |
| Books and notebooks logistic order#12646484 is in Exception State and its ETA is 10 Days |
| Mismatch in Production and load delivery |
| ordered item is not matching with origiinal order |
| I have found few mismatch in the ordered plant and received plant |
Desired Result:
| Title | Category |
| Books and notebooks logistic order#12646484 is in Exception State and its ETA is 10 Days | Books and Notebooks Order Issue |
| Mismatch in Production and load delivery | Mismatch in production & Load |
| ordered item is not matching with origiinal order | Order Mismatch |
| I have found few mismatch in the ordered plant and received plant | Plant micmatch Issue |
Please help me with the Dax query to achive this result if possible any hlep in this regard is much appreciated
Thanks and Regards
@member @Anonymous
Solved! Go to Solution.
Hi @Premlatapandey9 ,
You can create a calculated column.
Category =
SWITCH (
TRUE (),
CONTAINSSTRING ( TableName[Title], "Books and notebooks" ), "Books and Notebooks Order Issue",
CONTAINSSTRING ( TableName[Title], "Mismatch in Production" ), "Mismatch in production & Load",
CONTAINSSTRING ( TableName[Title], "ordered item" ), "Order Mismatch",
CONTAINSSTRING ( TableName[Title], "mismatch in the ordered plant" ), "Plant mismatch Issue",
"Other"
)
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Premlatapandey9 ,
You can create a calculated column.
Category =
SWITCH (
TRUE (),
CONTAINSSTRING ( TableName[Title], "Books and notebooks" ), "Books and Notebooks Order Issue",
CONTAINSSTRING ( TableName[Title], "Mismatch in Production" ), "Mismatch in production & Load",
CONTAINSSTRING ( TableName[Title], "ordered item" ), "Order Mismatch",
CONTAINSSTRING ( TableName[Title], "mismatch in the ordered plant" ), "Plant mismatch Issue",
"Other"
)
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hello @Anonymous This is amazing I am incredibly grateful for your time and expertise. Your willingness to help is awesom, and I wanted to express my sincere appreciation. Kudos to you for your outstanding efforts!
What if your text matches multiple categories? Do you have a preferred matching order?
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 19 | |
| 13 | |
| 9 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 30 | |
| 26 | |
| 17 | |
| 11 | |
| 10 |