Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
amandagabrielle
New 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, 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 2
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

lbendlin
Super User
Super User

Please do not use line feeds in column names

 

[#"PDD#(lf)Date"]

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.