Forum Discussion
Ramendra
Helper IV
5 years agoPower query expression for below excel formula
Can someone please help with power query expression for below excel formula. Where Extract date is the date column and A:A is the same date column in excel. I need correct expression for Power quer...
- 5 years ago
Hi, Ramendra
Use Date.AddDays([Extract Date],-3) to replace [Extract Date].
let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("Vc6xEYAgEADBXoidgT8EoRaG/tvATC/cbNdKFCKPHKR9farSLTWpS480pPkXRQpJF3RBF3RBF3RBF97LPg==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Extract Date" = _t]), #"Changed Type" = Table.TransformColumnTypes(Source,{{"Extract Date", type date}}), #"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each if Date.IsInCurrentWeek(Date.AddDays([Extract Date],-3)) then "This Week" else if Date.IsInPreviousWeek(Date.AddDays([Extract Date],-3)) then "Last Week" else "Other week") in #"Added Custom"Best Regards,
Community Support Team _ Eason
v-easonf-msft
Community Support
5 years agoHi, Ramendra
Use Date.AddDays([Extract Date],-3) to replace [Extract Date].
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("Vc6xEYAgEADBXoidgT8EoRaG/tvATC/cbNdKFCKPHKR9farSLTWpS480pPkXRQpJF3RBF3RBF3RBF97LPg==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Extract Date" = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Extract Date", type date}}),
#"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each if Date.IsInCurrentWeek(Date.AddDays([Extract Date],-3)) then "This Week" else if Date.IsInPreviousWeek(Date.AddDays([Extract Date],-3)) then "Last Week" else "Other week")
in
#"Added Custom"
Best Regards,
Community Support Team _ Eason
Ramendra
Helper IV
5 years agov-easonf-msft : Thanks for help.