Forum Discussion
Anonymous
6 years agoNot applicable
Regex and python script
Hello, I'm trying to use a regex expression in power bi and python and it doesn't want to work... I want to find a text that is starting with a E and ending with a comma (,). Here my code : ...
- 6 years ago
Hi, Anonymous
I'd like to suggest you achieve your requirement with dax. I created data to reproduce your scenario. The pbix file is attached in the end.
Table:
You may create a measure or a calculated column as below.
Calculated column: Result Column = var _text = 'Table'[Text] return IF( LEFT(_text,1)="E"&&RIGHT(_text,1)=",", _text ) Measure: Result Measure = var _text = SELECTEDVALUE('Table'[Text]) return IF( LEFT(_text,1)="E"&&RIGHT(_text,1)=",", _text )Result:
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
amitchandak
6 years agoSuper User
Anonymous , refer if this can help
- Anonymous6 years agoNot applicable
Thanks but I would like to do it with Python not R...