The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hi, I have been trying to find out the best way of parsing out the mfg lot from a group of serial numbers. Four consecutive numbers (Place values are 7-10, As shown below)
First two place are for the week and the second two the year. Can anyone show me how to accomplish this? A Dax calculation? Something?
Solved! Go to Solution.
Hi @Anonymousl,
This should do the trick...
let
Source = Table.FromRows(
Json.Document(
Binary.Decompress(
Binary.FromText("i45WMjAyNjXyMDUwNPcwMDC1MFaKjQUA", BinaryEncoding.Base64),
Compression.Deflate
)
),
let
_t = ((type nullable text) meta [Serialized.Text = true])
in
type table [Column1 = _t]
),
#"Changed Type" = Table.TransformColumnTypes(Source, {{"Column1", type text}}),
#"Inserted Text Range" = Table.AddColumn(
#"Changed Type",
"Text Range",
each Text.Middle([Column1], 6, 4),
type text
)
in
#"Inserted Text Range"
The key is the Text.Middle.
Hope this helps.
Have I solved your problem? Please click Accept as Solution so I don't keep coming back to this post, oh yeah, others may find it useful also ;). |
If you found this post helpful, please give Kudos. It gives me a sense of instant gratification and, if you give me Kudos enough times, magical unicorns will appear on your screen. If you find my signature vaguely amusing, please give Kudos. | Proud to be a Super User! |
Hi,
This calculated column formula should work
=mid(Data[text],7,4)
Hi @Anonymousl,
This should do the trick...
let
Source = Table.FromRows(
Json.Document(
Binary.Decompress(
Binary.FromText("i45WMjAyNjXyMDUwNPcwMDC1MFaKjQUA", BinaryEncoding.Base64),
Compression.Deflate
)
),
let
_t = ((type nullable text) meta [Serialized.Text = true])
in
type table [Column1 = _t]
),
#"Changed Type" = Table.TransformColumnTypes(Source, {{"Column1", type text}}),
#"Inserted Text Range" = Table.AddColumn(
#"Changed Type",
"Text Range",
each Text.Middle([Column1], 6, 4),
type text
)
in
#"Inserted Text Range"
The key is the Text.Middle.
Hope this helps.
Have I solved your problem? Please click Accept as Solution so I don't keep coming back to this post, oh yeah, others may find it useful also ;). |
If you found this post helpful, please give Kudos. It gives me a sense of instant gratification and, if you give me Kudos enough times, magical unicorns will appear on your screen. If you find my signature vaguely amusing, please give Kudos. | Proud to be a Super User! |
Thank you! It worked perfect!!