Forum Discussion
IF and Statement in Excel Power Query
- 2 years ago
in the example data you gave the Amount_A values were null.
Changed the code so it works with = 0 too 🙂if [Amount_A] = null or [Amount_A] = 0 then
if [Amount_C] = null or [Amount_C] = 0 then
if [Amount_B] = 0 or [Amount_B] = nullthen null
else "Expiring"
else "Renewed"
else [Type]
You will have to add another custome column in Powerqueryas following,
= if [Type] <> null and [Type] <> "" then [Type]
else if [Amount C] <> 0 or [Amount C] <> null then "Renewed"
else if ([Amount B] = 0 or [Amount B] = null) and ([Amount C] = 0 or [Amount C] = null) then ""
else "Expiring"
Please accept it as solution if works.
- kd_pandey2 years agoRegular Visitor
this is the result of both solutions .. expring is missing in both
- BenjaminSNN2 years agoFrequent Visitor
in the example data you gave the Amount_A values were null.
Changed the code so it works with = 0 too 🙂if [Amount_A] = null or [Amount_A] = 0 then
if [Amount_C] = null or [Amount_C] = 0 then
if [Amount_B] = 0 or [Amount_B] = nullthen null
else "Expiring"
else "Renewed"
else [Type]- kd_pandey2 years agoRegular Visitor
my bad .. I changed it to 0 in last moment while uploading to make it more simple which missed your first line of code.. thank you so much