Forum Discussion
Auski
1 year agoAdvocate I
Multiple IF, AND statements in one column
Hey all, I have had incredible success finding solutions in this forum that I thought I would try my luck again! I am hoping to create a single column that tells me if an SLA missed or met base...
- 1 year ago
You can pretty much take your statement and convert it straight into a SWITCH
New Column = SWITCH( TRUE(), ISBLANK([SLA]),BLANK(), [SLA] = "60 Mins" && [Age_Hours] <=1,"SLA Met", [SLA] = "12 Hours" && [Age_Hours] <=12,"SLA Met", [SLA] = "24Hours" && [Age_Hours] <=24,"SLA Met", [SLA] = "3 Business Day" && [Bus Hours Open] <=27,"SLA Met", [SLA] = "4 Business Day" && [Bus Hours Open] <=36"SLA Met", [SLA] = "5 Business Day" && [Bus Hours Open] <=45"SLA Met", [SLA] = "10 Business Days" && [Bus Hours Open] <=90,"SLA Met", [SLA] = "Action Date" && [Action Date Resolution] = "Y","SLA Met", "SLA Fail")
adudani
1 year agoMemorable Member
hi Auski ,
steps:
1. go to the "Add Column" Tab
2. Click on "Custom Column"
3. Give the column a name
4. paste the below formula
if [SLA] = “” the null else
if [SLA] = “60 Mins" and [Age_Hours] <=1, then "SLA Met" else
if [SLA] = "12 Hours" and [Age_Hours] <=12, then "SLA Met" else
if [SLA] = "24Hours" and [Age_Hours] <=24, then "SLA Met" else
if [SLA] = "3 Business Day" and [Bus Hours Open] <=27, then "SLA Met" else
if [SLA] = "4 Business Day" and [Bus Hours Open] <=36, then "SLA Met" else
if [SLA] = "5 Business Day" and [Bus Hours Open] <=45, then "SLA Met" else
if [SLA]= "10 Business Days" and [Bus Hours Open] <=90, then "SLA Met" else
if [SLA] = "Action Date" and [Action Date Resolution] = "Y", then "SLA Met" else
else "SLA Fail"
for reference: Mastering the IF Function in Power Query - including Nested-IF statements (Complete Guide) - YouTube
if this doesn't resolve the issue, kindly share the sample input in a usable format ( table, csv etc.)