Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.
Hi All
How to recode Value lable for SourceName :-
SI_PM.CSV to PM
SI_SD.CSV to SD
Take the 4 and 5 charater. As i have many file.
https://www.dropbox.com/s/7tk5tqkonpuama4/M%20CODE%20LOAD%20CSV%20FILE%20V002.pbix?dl=0
Above link is my PBI FILE
Paul
Solved! Go to Solution.
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
@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
Hi Sir
I try to use your expression , i get error msg. Can you share with me where go wrong ?
@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 Sir
Thank you it work fine now.
Paul
Thank you AIB.
Hi Sir
Yes for this it is better not using M code. Thank you very much for sharing.
Paul
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.
User | Count |
---|---|
83 | |
42 | |
30 | |
27 | |
27 |