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

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
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,903
Messages
6,175,289
Members
452,631
Latest member
a_potato

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