Forum Discussion
bprakash
8 years agoRegular Visitor
Substring in Power BI ?!
I have a text date field in format FY18-Q2-5, last digit being the week number (here in this example 5 is the week number). I want to substring 5 from above date field & put '0' infront of week n...
bprakash
8 years agoRegular Visitor
Thanks everyone
v-jiascu-msft
8 years agoMicrosoft Employee
Hi bprakash,
Solution can change the data directly by modifying the code in the Advanced Editor. Please the demo here.
#"Replaced Value" = Table.ReplaceValue(#"Changed Type", each [Column1],each if Number.FromText(Text.AfterDelimiter([Column1], "-", 1)) < 10 then Text.Replace([Column1],"-" & Text.AfterDelimiter([Column1], "-", 1), "-0" & Text.AfterDelimiter([Column1], "-", 1)) else [Column1],Replacer.ReplaceText,{"Column1"})
Best Regards,
Dale