Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
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.
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.
Hi @Dinesh_Suranga, yes I did. Would you help me to see what could be wrong with my queries as above? Thanks
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.
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,
User | Count |
---|---|
84 | |
69 | |
69 | |
65 | |
54 |
User | Count |
---|---|
93 | |
93 | |
91 | |
76 | |
69 |