Forum Discussion
[DAX] isolate text from text
- 9 years ago
Well, I'm not a DAX expert, but from my Excel background I constructed the following DAX formula.
Prerequisite is that your strings don't contain any ^ character.=right([String],len([String])-find("^",substitute([String],"-","^",-1+len([String])-len(SUBSTITUTE([String],"-","")))))
In Power Query it can be done with:
= Table.AddColumn(Source, "ProductNumber", each Text.Range([String],1+List.First(List.LastN(Text.PositionOf([String],"-",Occurrence.All),2))))
- PascalT9 years agoHelper I
Hi Marcel
Thank you very much. As i'm not yet very confortable with the PowerQuery, is it possible to do it in DAX. I'll create a new column for it.
In all the case, thank you very much, your help is really appreaciated.
Pascal
- Sean9 years agoCommunity Champion
If the ProductNumber is always 11 characters you are in business :smileyhappy:
Hope this helps! :smileyhappy:
- PascalT9 years agoHelper I
Hi and thank you too.
Unfortunatly, i can't do like that as the numbers are not always with the same length.
Most of the time, there are 8 + 3 numbers but it can happend that we have 7 + 3 or 8 + 2
Thank you for your help
Pascal