Forum Discussion
midlandjoe
3 years agoFrequent Visitor
Calculate a date based on text value
Hi everyone. New to power query here. Wondering if you can help me with this. I have a table containing some data regarding tasks, and would like to calculate a date based on the urgency rating. ...
midlandjoe
3 years agoFrequent Visitor
Sorry, I guess I'm just a little confused -- as I already have quite a few different columns in my table. I'm also sourcing the data from Sharepoint so my advanced query editor is a little harder to edit.
Is there another way that this can be achieved without adding / editing the query?
ppm1
Solution Sage
3 years agoThe provided M code is just an example. You can just add a custom column in your existing query and put this formula in the pop-up box.
= if [Urgency] = "not urgent" then Date.AddMonths([Date Submitted], 1) else if [Urgency] = "fairly urgent" then Date.AddDays([Date Submitted], 17) else Date.AddDays([Date Submitted], 7)
Pat