I have written an if statement to determine if each project in a list is active. I am having trouble with the syntax. the comparison dates, activeperiodstart and activeperiodend date come from anothertable.
the section reads:
Result2 = Table.AddColumn(#"Expanded Table1", "ActiveProject", each let
activeperiodstartdate = ExtXLFileDates[StartDate],
activeperiodenddate = ExtXLFileDates[endDate]
in
IF ([Activity Start]="null" and [Activity End]="null") then "N" else
IF([Activity Start]="null" and [Activity End]>activeperiodstartdate and [Activity End]<activeperiodenddate) then "Y" else
IF([Activity End]="null" and [Activity Start]>activeperiodstartdate and [Activity Start]<activeperiodenddate) then "Y" else
IF([Activity Start]>activeperiodstartdate and [Activity Start]<activeperiodenddate) then "Y" else
IF([Activity End]<activeperiodenddate and [Activity End]>activeperiodstartdate) then "Y" else
IF([Activity End]<activeperiodstartdate and [Activity End]>activeperiodenddate) then "Y" else "N"),
#"Replaced Errors2" = Table.ReplaceErrorValues(Result2, {{"ActiveProject", "N"}})
in
#"Replaced Errors2"
when i click on Show Error, the "then" in the first line of the in statement is highlighted
any suggestions?
the section reads:
Result2 = Table.AddColumn(#"Expanded Table1", "ActiveProject", each let
activeperiodstartdate = ExtXLFileDates[StartDate],
activeperiodenddate = ExtXLFileDates[endDate]
in
IF ([Activity Start]="null" and [Activity End]="null") then "N" else
IF([Activity Start]="null" and [Activity End]>activeperiodstartdate and [Activity End]<activeperiodenddate) then "Y" else
IF([Activity End]="null" and [Activity Start]>activeperiodstartdate and [Activity Start]<activeperiodenddate) then "Y" else
IF([Activity Start]>activeperiodstartdate and [Activity Start]<activeperiodenddate) then "Y" else
IF([Activity End]<activeperiodenddate and [Activity End]>activeperiodstartdate) then "Y" else
IF([Activity End]<activeperiodstartdate and [Activity End]>activeperiodenddate) then "Y" else "N"),
#"Replaced Errors2" = Table.ReplaceErrorValues(Result2, {{"ActiveProject", "N"}})
in
#"Replaced Errors2"
when i click on Show Error, the "then" in the first line of the in statement is highlighted
any suggestions?