Forum Discussion
amandagabrielle
3 years agoNew Member
Help wihth date error with power query
Eu tenho este código: = Table.AddColumn(#"Tipo Alterado2", "jan", cada se [Status ADL]= "Late" e [#"PDD#(lf)Date"]< Date.EndOfMonth(#date(2023, 1, 1)) e [Finish Date]> Date.EndOfMonth(#date(2022, 12...
Anonymous
3 years agoNot applicable
Hi amandagabrielle ,
Please try:
= Table.AddColumn(
#"Tipo Alterado2",
"jan",
each
if [Status ADL]
= "Late" and [#"PDD#(lf)Date"]
< Date.EndOfMonth(#date(2023, 1, 1)) and [Finish Date]
> Date.EndOfMonth(#date(2022, 12, 1)) and [Finish Date] <> " " and [Finish Date]
< Date.EndOfMonth(#date(2023, 1, 1))
then
[Finish Date] - [#"PDD#(lf)Date"]
else if [Status ADL] = "Late" and [#"PDD#(lf)Date"] = Date.EndOfMonth(#date(2023, 1, 1)) then
"0"
else if [Status ADL]
= "Late" and [#"PDD#(lf)Date"]
< Date.EndOfMonth(#date(2023, 1, 1)) and [Finish Date]
> Date.EndOfMonth(#date(2022, 12, 1)) and [Finish Date] <> "" and [Finish Date]
> Date.EndOfMonth(#date(2023, 1, 1))
then
Date.EndOfMonth(#date(2023, 1, 1)) - [#"PDD#(lf)Date"] + 2023
else if [Status ADL] <> "Late" then
""
else if [#"PDD#(lf)Date"] <> Date.EndOfMonth(#date(2023, 1, 1)) then
""
else
""
)
)
Best Regards,
Gao
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum