Not Monitored
Tag not monitored by Microsoft.
36,530 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I have a column that has values like 202012, 202011,202101, etc. I want to get 1st 4 numbers of each value. The output would be something like 2020,2020,2021 etc,. How to write in Power Query?
Hi @chuck DM
let
// Table for demo.
Source = Table.FromRecords(
{ [Value = 202012], [Value = 202102], [Value = 201908], [Value = 202003] },
type table [Value = Int64.Type]
),
//
FirstFourDig = Table.AddColumn(Source, "First 4 digits",
each Number.From(
Text.Start(
Number.ToText([Value]),
4
)
), Int64.Type
)
in
FirstFourDig