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 all,
I have a custom column with the following formula:
if Text.Length([Option Effective Date]) = null then Date.AddMonths([Option Start Date], [Notice Period]) else [Option Effective Date]
I am trying to apply logic that says that is the [Option Effective Date] column doesn't have a date in it (it either does or just reads 'null') then take the date from column [Option Start Date] and advance the months by the number in column [Notice Period].
Else just use the date in the [Option Effective Date] column.
Dates are pulled through when the condition is true. However I get error in cells with the above error message for the Else logic.
What am I doing wrong?
Solved! Go to Solution.
In your case, Text.Length is not required. Hence, this would be enough.
= if [Option Effective Date] = null then Date.AddMonths([Option Start Date], [Notice Period]) else [Option Effective Date]
If you want to test for the presence of a date field
= if Value.Is(Date.From([Option Effective Date]), type date) then Date.AddMonths([Option Start Date], [Notice Period]) else [Option Effective Date]
In your case, Text.Length is not required. Hence, this would be enough.
= if [Option Effective Date] = null then Date.AddMonths([Option Start Date], [Notice Period]) else [Option Effective Date]
If you want to test for the presence of a date field
= if Value.Is(Date.From([Option Effective Date]), type date) then Date.AddMonths([Option Start Date], [Notice Period]) else [Option Effective Date]
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 |
---|---|
102 | |
53 | |
21 | |
13 | |
11 |