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.
Hi everyone,
I have a date type field. and would like to add an amount of weeks to that, in a calculated column.
Example data:
Code | Date |
1 | 01/10/2019 |
1 | 01/10/2019 |
2 | 01/10/2019 |
3 | 01/10/2019 |
Desired outcome:
Code | Date | Deadline: |
1 | 01/10/2019 | 15/10/2019 |
1 | 01/10/2019 | 15/10/2019 |
2 | 01/10/2019 | 22/10/2019 |
3 | 01/10/2019 | 29/10/2019 |
So if code = 1 i want to add 2 weeks. when 2, 3 weeks and when 3 i'd like to add 4 weeks.
I tried using DATEADD()
but i could not get that to work. Anyone got a solution?
Thankyou!
Quality over Quantity
Solved! Go to Solution.
Good day budd,
One of the things that you can do to help you get what you looking for is to create a custom column in the Query Editor and with a simple code magic will happen 🙂
Code:
= Table.AddColumn(#"Removed Columns", "DeadLine",
each if [Code] = 1 then Date.AddDays([Date],14) else if [Code] = 2 then Date.AddDays([Date],21) else if [Code] = 3 then Date.AddDays([Date],28) else null)
Best of luck 😉
Hicham
Good day budd,
One of the things that you can do to help you get what you looking for is to create a custom column in the Query Editor and with a simple code magic will happen 🙂
Code:
= Table.AddColumn(#"Removed Columns", "DeadLine",
each if [Code] = 1 then Date.AddDays([Date],14) else if [Code] = 2 then Date.AddDays([Date],21) else if [Code] = 3 then Date.AddDays([Date],28) else null)
Best of luck 😉
Hicham
Thanks!
I was constantly searching for things with weeks. But days could ofcourse work just as fine!
Quality over Quantity
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 |
---|---|
115 | |
99 | |
88 | |
70 | |
62 |
User | Count |
---|---|
151 | |
120 | |
103 | |
87 | |
68 |