Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hello Everybody,
i have a probem in writing an if function with power query.
I have table with "delivery date wish customer" (gepl.Versanddatum) and "delivery date possible" (machbarer Termin)
Problem is that it could be that the "delivery date possible" is a empty cell because the date is equal to "delivery date wish customer".
Therefore i wrote the following formula with the formula editor from "add customer column"
if [#"xmr_vk_analyse (2).Machbarer Termin"] is null then Date.WeekOfYear [#"xmr_vk_analyse (2).gepl. Versanddatum"] else Date.WeekOfYear [#"xmr_vk_analyse (2).Machbarer Termin"]
This leads to the error message shon in the picture at the end of this contribution.
What is wrong with this formula?
Thanks in advance for helping.
Solved! Go to Solution.
Please try this instead
if [#"xmr_vk_analyse (2).Machbarer Termin"] = null then Date.WeekOfYear ([#"xmr_vk_analyse (2).gepl. Versanddatum"]) else Date.WeekOfYear ([#"xmr_vk_analyse (2).Machbarer Termin"])
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
Please try this instead
if [#"xmr_vk_analyse (2).Machbarer Termin"] = null then Date.WeekOfYear ([#"xmr_vk_analyse (2).gepl. Versanddatum"]) else Date.WeekOfYear ([#"xmr_vk_analyse (2).Machbarer Termin"])
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
Hey Mahoneypat,
thanks for your help. It works.
Question: Could you please explain to me why if to use " = null" instead of is? Or did I get it wrong and I have allways to use "sings" of logical operations as "=;<;>" when I'm writting a IF statement?
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.
| User | Count |
|---|---|
| 5 | |
| 3 | |
| 3 | |
| 3 | |
| 2 |
| User | Count |
|---|---|
| 7 | |
| 5 | |
| 5 | |
| 5 | |
| 4 |