Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by watching the DP-600 session on-demand now through April 28th.
Learn moreJoin the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now
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 | Column AB | Column R |
| Pending Hold | 179.9 | 12 | 8/23/2022 |
| New | 38.7 | 8 | 7/02/2022 |
The new column should be containing:
| Column U | Column A | Column AB | Column R | SLA |
| Pending Hold | 179.9 | 12 | 8/23/2022 | Out of SLA |
| New | 38.7 | 8 | 7/02/2022 | Out of SLA |
I've tried using try otherwise and calculate function, I'm having a hard time to get it running
Thank you in advance
Solved! Go to Solution.
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 "-")
I actually figure out already what's wrong with code, I actually state a wrong column name for ColumnAB, @wdx223_Daniel's code did work, thank you so much @jbwtp as well
Thank you guys
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 "-")
Hi @wdx223_Daniel,
Thank you for providing a solution, however, it's giving me a Expression.SyntaxError: Token Eof expected,
can't figure where I went wrong
Hi @Anonymous,
I think this might be missing else instead if comma (,) in this bit:
then "Out of SLA","In SLA".
Kind regards,
John
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")
Check out the April 2026 Power BI update to learn about new features.
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.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
| User | Count |
|---|---|
| 5 | |
| 5 | |
| 4 | |
| 4 | |
| 4 |