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
Dear Power BI users,
I have a filtering issues that needs your support:
The data I have looks like this:
| Item | Category |
| A | X1; X3; X5 |
| B | X3; X5; X7 |
| C | X4; X8; X9 |
| D | X5; X8 |
| E | X11; X12 |
| F | X9; X5 |
Now I would like to see those Items that have "X3 or X5 or X7". In this case, item C & E will NOT appear.
What would be the way to do this effectively? Given that my actual data has hundred of categories need to be filtered.
Thanks a lot,
Solved! Go to Solution.
@Anonymous
Hi
I gave you a DAX code. You can not use it in power query side.
Please try following M code in power query.
if Text.Contains([Category] , "X3") or Text.Contains([Category] , "X5") or Text.Contains([Category] , "X7") then "True" else "False"Thank you.
@Anonymous
Did you change table name and column name according to your data table?
Thanks
Hi @Dinesh_Suranga, yes I did. Would you help me to see what could be wrong with my queries as above? Thanks
@Anonymous
Hi
I gave you a DAX code. You can not use it in power query side.
Please try following M code in power query.
if Text.Contains([Category] , "X3") or Text.Contains([Category] , "X5") or Text.Contains([Category] , "X7") then "True" else "False"Thank you.
Sorry my bad, but when I tried it in DAX, it's still not return desirable outcome
So thank you very much, I'll accept this as a solution.
But when I tried in Power Query, it works perfectly.
@Anonymous
Hi,
Please try following DAX code.
Measure = CONTAINSSTRING( SELECTEDVALUE('Table'[Category]),"X3") || CONTAINSSTRING( SELECTEDVALUE('Table'[Category]),"X5") || CONTAINSSTRING( SELECTEDVALUE('Table'[Category]),"X7")
Then you can filter True values.
If this helps you to solve your issue. Please accept this as the solution.
Thank you.
Hi,
I tried it but it showed error: "Token eof expected"
Could you send me your pbix file as an example for this?
I'd really appreciate it.
Best regards,
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 |