March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi,
Please can you tell me the Power Query M code equivalent for the "iferror" function in excel?
Thanks,
CM
Solved! Go to Solution.
use "try....otherwise".
try <some code hear that may result in an error> otherwise <run this code in case of error>
note that try and otherwise are NOT capitalized. Also, no commas are needed.
Hi all,
unfortunately this doesn't solve my issue.
If something like (4) happens, in column B must be written 31.12.2030 (e.g) and in a third column "check supplydate".
How can I fix this?
Maybe iferror / try.....otherwise is the wrong idea?
Thx in advance for your help.
@Anonymous try this:
let Source = Table.FromList({[TextField ="02.01.2019 - 02.28.2019"],[TextField ="02.01.2019 - 02.30.2019"]},Record.FieldValues, {"TextField"}), #"Added StartDate" = Table.AddColumn(Source, "StartDate", each try Date.FromText(Text.BeforeDelimiter([TextField], " ")) otherwise Date.FromText("12/31/2030")), #"Added EndDate" = Table.AddColumn(#"Added StartDate", "EndDate", each try Date.FromText(Text.AfterDelimiter([TextField], " ", 1)) otherwise Date.FromText("12/31/2030")), #"Added Action" = Table.AddColumn(#"Added EndDate", "Action", each if [StartDate] = Date.FromText("12/31/2030") or [EndDate] = Date.FromText("12/31/2030") then "check supplydate" else "") in #"Added Action"
Hi Bekah,
this works perfect - thank you very much...
Best wishes
Hi @CloudMonkey,
Could you please mark the proper answer as solution or share the solution if it's convenient for you? That will be a big help to the others.
Best Regards!
Dale
Hi @CloudMonkey,
Related documentations: https://msdn.microsoft.com/en-us/library/mt186368.aspx and https://msdn.microsoft.com/en-US/library/mt267542.aspx.
Best Regards!
Dale
use "try....otherwise".
try <some code hear that may result in an error> otherwise <run this code in case of error>
note that try and otherwise are NOT capitalized. Also, no commas are needed.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
115 | |
76 | |
57 | |
52 | |
44 |
User | Count |
---|---|
165 | |
116 | |
63 | |
57 | |
50 |