Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
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 @v-tangjie-msft 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?
User | Count |
---|---|
57 | |
22 | |
21 | |
19 | |
16 |
User | Count |
---|---|
87 | |
87 | |
52 | |
37 | |
23 |