Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Dear Community,
i have a Column with ascending dates and need the starting date of each week in a second column:
I need this in Power Query. Example File here.
Thanks and regards, Michael
Solved! Go to Solution.
Hi @Rygar ,
Create a Custom Column in Power Query and enter this:
=Date.StartOfWeek([From this], Day.Monday)
where [From this] equals name of your date column
@Rygar Use this:
let
Source = Table.FromRows (
Json.Document (
Binary.Decompress (
Binary.FromText (
"Vc67DcAwDAPRXVwHkER/Ys1ieP81DBdByPJVd2uVaUiDA2U/V9VF8StNAEZlNEZnDMbLmIyUqIt0SCZCLuLb2Ac=",
BinaryEncoding.Base64
),
Compression.Deflate
)
),
let
_t = ( ( type nullable text ) meta [ Serialized.Text = true ] )
in
type table [ #"From this" = _t ]
),
ChangedType = Table.TransformColumnTypes ( Source, { { "From this", type date } } ),
WeekOfYear =
Table.AddColumn (
ChangedType,
"Week of Year",
each Date.WeekOfYear ( [From this], Day.Monday ),
Int64.Type
),
GroupedRows =
Table.Group (
WeekOfYear,
{ "Week of Year" },
{
{
"Transformation",
( Dates ) =>
Table.AddColumn (
Table.RemoveColumns ( Dates, "Week of Year" ),
"To this",
each List.Min ( Dates[From this] ),
type date
)
}
}
),
RemovedOtherColumns = Table.Combine ( GroupedRows[Transformation] )
in
RemovedOtherColumns
Thanks a lot 4 your support!
Hi @Rygar ,
Create a Custom Column in Power Query and enter this:
=Date.StartOfWeek([From this], Day.Monday)
where [From this] equals name of your date column
Great! Thanks a lot.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
100 | |
51 | |
19 | |
12 | |
11 |