Forum Discussion
Anonymous
3 years agoNot applicable
Nested if in PowerBI- Power Query
Hi Guys, Reaching out for help. I'm new in using PowerBI and with PowerQuery. I'm trying to bring this nested if function that I have used in GSheets: Here's the table Column U Column A ...
- 3 years ago
NewStep=Table.AddColumn(PreviousStepName,"SLA",each let a=if [ColumnA]>[Column AB] then "Out of SLA","In SLA",b=Date.From(DateTime.LocalNow()),c=if [ColumnU]<>"Pending Hold" then a else if [ColumnR]=b then "Due Today" else if [ColumnR]<b then "Out of SLA Pending Hold" else "Future Follow Up Date" in try c otherwise "-")
jbwtp
3 years agoMemorable Member
Hi Anonymous,
I think this might be missing else instead if comma (,) in this bit:
then "Out of SLA","In SLA".
Kind regards,
John
jbwtp
3 years agoMemorable Member
a bit more structured, and maybe esier to read:
= Table.AddColumn(PreviousStep,"SLA",each
if [Column U]<>"Pending Hold"
then
if [Column A]>[Column AB]
then "Out of SLA"
else "In SLA"
else
if Date.From([Column R], "en_US")=Date.From(DateTime.LocalNow())
then "Due Today"
else
if Date.From([Column R], "en_US")<Date.From(DateTime.LocalNow())
then "Out of SLA Pending Hold"
else "Future Follow Up Date")