Power Query - Enter date based on criteria of 3 other cells

karmaimages

Board Regular
Joined
Oct 1, 2009
Messages
112
Office Version
  1. 365
Platform
  1. Windows
Hi

I have a list of information in excel which I'd like to transform in Power Query along with some other quires in the workbook, the information is structured as follows:

SeverityImpactDate loggedSLA
A101/01/2022=IF Severity = A then Date Logged+2 Months
B101/01/2022=IF Severity = B then Date logged + 9 Months
C101/01/2022= If Severity = C then Date logged + 12 Months
D101/01/2022=IF Severity = D & Impact = 1 then Date logged + 9 Months
D201/01/2022=IF Severity = D & Impact = 2 then Date logged + 9 Months

D301/01/2022=IF Severity = D & Impact = 3 then Date logged + 12 Months

D401/01/2022=IF Severity = D & Impact = 4 then Date logged + 12 Months


If there any way to perform the function required in the SLA column using Power Query and how would this be written so this applied to any new data pulled into the report?

Any help much appreciated.

Many Thanks
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
Power Query:
=if [Severity]="A" then Date.AddMonths([Date logged],2)
else if [Severity]="B" then Date.AddMonths([Date logged],9)
else if [Severity]="C" then Date.AddMonths([Date logged],12) 
else if([Severity]="D" and [Impact]<=2) then Date.AddMonths([Date logged],9) 
else if([Severity]="D" and [Impact] >2) then Date.AddMonths([Date logged],12) else "NADA"
1664373165288.png
 
Upvote 0
Solution

Forum statistics

Threads
1,223,099
Messages
6,170,111
Members
452,302
Latest member
TaMere

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top