Forum Discussion
I am looking to make Events numbered based on specific dates and make the process dynamic.
- 2 years ago
Hello ssm_214,
I'm not sure if I understand your question correctly. My following code Creates the TimeFrame column based on Approved Date. If the approval date is between December (12) and February (2), enter the number 1, and if the approval date is between May (5) and July (7), enter the number 2.
Did I understand you correctly?
let Source = YOUREXCELFILE, Type = Table.TransformColumnTypes(Source,{{"Approved Date", type date}}), ColumnTimeFrame = Table.AddColumn(Type, "TimeFrame", each if Date.Month([Approved Date]) >= 12 or Date.Month([Approved Date]) <= 2 then 1 else if Date.Month([Approved Date]) >= 5 or Date.Month([Approved Date]) <= 7 then 2 else null , Int64.Type) in ColumnTimeFrame
Best regards from Germany
Manuel Bolz
If this post helped you, please consider Accept as Solution so other members can find it faster.
🤝Follow me on LinkedIn
Hello ssm_214,
I'm not sure if I understand your question correctly. My following code Creates the TimeFrame column based on Approved Date. If the approval date is between December (12) and February (2), enter the number 1, and if the approval date is between May (5) and July (7), enter the number 2.
Did I understand you correctly?
let
Source = YOUREXCELFILE,
Type = Table.TransformColumnTypes(Source,{{"Approved Date", type date}}),
ColumnTimeFrame = Table.AddColumn(Type, "TimeFrame", each
if Date.Month([Approved Date]) >= 12 or Date.Month([Approved Date]) <= 2
then 1
else if Date.Month([Approved Date]) >= 5 or Date.Month([Approved Date]) <= 7
then 2
else null
, Int64.Type)
in
ColumnTimeFrame
Best regards from Germany
Manuel Bolz
If this post helped you, please consider Accept as Solution so other members can find it faster.
🤝Follow me on LinkedIn