Forum Discussion
How to recode Source.Name using M code ?
- 5 years ago
Hi Anonymous
If it's the 4th and 5th characters that you want, you can create a custom column with this code:
= Text.Middle( [Source.Name], 3, 2)
Then you can delete the original Source.Name column if necessary and rename the newly created column
Or you can use Table.TransformColumns( ) but the option above is probably easier
Please mark the question solved when done and consider giving a thumbs up if posts are helpful.
Contact me privately for support with any larger-scale BI needs, tutoring, etc.
Cheers
- 5 years ago
Anonymous
You asked for a solution in M code, which is what I provided. In the pic you seem to be trying to do it in DAX. If that is the case, you can create a calculated column with
New col = MID(Table1[Source Name], 4, 2)Please mark the question solved when done and consider giving a thumbs up if posts are helpful.
Contact me privately for support with any larger-scale BI needs, tutoring, etc.
Cheers
Hi Anonymous
If it's the 4th and 5th characters that you want, you can create a custom column with this code:
= Text.Middle( [Source.Name], 3, 2)
Then you can delete the original Source.Name column if necessary and rename the newly created column
Or you can use Table.TransformColumns( ) but the option above is probably easier
Please mark the question solved when done and consider giving a thumbs up if posts are helpful.
Contact me privately for support with any larger-scale BI needs, tutoring, etc.
Cheers
- Anonymous5 years agoNot applicable
Hi Sir
Yes for this it is better not using M code. Thank you very much for sharing.
Paul
- Anonymous5 years agoNot applicable
Hi Sir
I try to use your expression , i get error msg. Can you share with me where go wrong ?
- AlB5 years ago
Community Champion
Anonymous
You asked for a solution in M code, which is what I provided. In the pic you seem to be trying to do it in DAX. If that is the case, you can create a calculated column with
New col = MID(Table1[Source Name], 4, 2)Please mark the question solved when done and consider giving a thumbs up if posts are helpful.
Contact me privately for support with any larger-scale BI needs, tutoring, etc.
Cheers
- Anonymous5 years agoNot applicable
Thank you AIB.