Forum Discussion

amandagabrielle's avatar
amandagabrielle
New Member
3 years ago

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, 1, 5)) e [Finish Date] <> " " e [Finish Date] < Date.EndOfMonth(#date(2023, 1, 1)) então [Finish Date]-[#"PDD#(lf)Date"] else
if [Status ADL]= "Late" e [#"PDD#(lf)Date"] = Date.EndOfMonth(#date(2023, 1, 1)) então "0" se
[Status ADL]="Late" e [#"PDD#(lf)Date"] = Date.EndOfMonth(#date(2023, 1, 1)) então "0" else
if [Status ADL]= "Late" e [#"PDD#(lf)Date"] < Date.EndOfMonth(#date(2023, 1, 1)) e [Finish Date]> Date.EndOfMonth(#date(2022, 12, 1)) e [Finish Date] <> "" e [Finish Date] > Date.EndOfMonth(#date(2023,1,1)) e depois Date.EndOfMonth(#date(2023, 1, 1, 1)) - [#"PDD#(lf)Date"] +2023 else if [Status ADL] <> "Late" então "" else if [#"PDD#(lf)Date"] <> Date.EndOfMonth(#date(1, 1, <>)) então "" else


""

e este problema:

Expression.Error: 4 argumentos foram passados para uma função, que esperava 3.
Detalhes:
Pattern=Arguments=
[List]

Como faço?

2 Replies

  • Please do not use line feeds in column names

     

    [#"PDD#(lf)Date"]

  • Anonymous's avatar
    Anonymous
    Not 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