Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowData Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more
I have a requirement to find whether a string given in Logon column contains a 'wauser' pattern ornot . If it contains the pattern it should return 1,if not 0.
I have data shown below
| Qty | Logon | Tran_Date | Item_Nbr |
| -100 | memwauser:MEM.MAIN | 9/17/2024 | 44675F|20 |
| -100 | memwauser:MEM.MAIN | 10/15/2024 | 44152F|20 |
| 1,313 | cmurray:CBC.MAIN | 9/17/2024 | 43807|01 |
| 1,313 | joldenburg:CBC.MAIN | 9/17/2024 | 43807|01 |
Final Result should look like
| Qty | Logon | Tran_Date | Item_Nbr | Usertype |
| -100 | memwauser:MEM.MAIN | 9/17/2024 | 44675F|20 | 1 |
| -100 | memwauser:MEM.MAIN | 10/15/2024 | 44152F|20 | 1 |
| 1,313 | cmurray:CBC.MAIN | 9/17/2024 | 43807|01 | 0 |
| 1,313 | joldenburg:CBC.MAIN | 9/17/2024 | 43807|01 | 0 |
Can you please let me know how this can be achieved using DAX in Power BI Desktop ?
Thanks..
Solved! Go to Solution.
Hi @csb,
You may want to add the following measure to get what you need:
UserType =
IF(CONTAINSSTRING(SELECTEDVALUE('Table'[Logon]), "memwauser"), 1, 0)
@csb
You can add calculated column as follows:
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
Your solution is so great Fowmy and wini_R
Hi, @csb
I wish you all the best. Previously Super user and wini_R have provided a solution to help you solve the problem. Since we haven't heard back from you yet, I'd like to confirm if you've successfully resolved this issue or if you need further help?
If yes, you are welcome to share your workaround and mark it as a solution so that other users can benefit as well. If you find a reply particularly helpful to you, you can also mark it as a solution.
If you still have any questions or need more support, please feel free to let us know. We are more than happy to continue to help you.
Thank you for your patience and look forward to hearing from you.
Best Regards
Jianpeng Li
@csb
You can add calculated column as follows:
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
Hi @csb,
You may want to add the following measure to get what you need:
UserType =
IF(CONTAINSSTRING(SELECTEDVALUE('Table'[Logon]), "memwauser"), 1, 0)
Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.
Check out the May 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 23 | |
| 23 | |
| 21 | |
| 20 | |
| 15 |
| User | Count |
|---|---|
| 58 | |
| 54 | |
| 42 | |
| 30 | |
| 24 |