Forum Discussion
MarcusR1
Helper II
3 years agoUsing Python Regex to look for values in column
I'm trying to add a column called ofInterest select postcodes that match RG, OX & SA, the column would contain a 1 if the match is found, or 0 if not found. My code is: import pandas as pd impo...
Anonymous
3 years agoNot applicable
Hi MarcusR1 ,
According to your description, here are my steps you can follow as a solution.
(1)This is my test data.
Table:
Table(2):
And the relationships between tables:
(2)We can create a measure.
ofInterest = var _t = {"OX","RG","SA"} return IF( MAX('Table'[Type]) in _t , 1 ,0)
(3)Then the result is as follows.
Please refer to the following documents that may be helpful:
Using regular expressions in power bi desktop - Microsoft Power BI Community
Regular expressions in Power Query – Q-stat
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.