Forum Discussion
Calculate a date based on text value
What do you think is being done? It appears to me as if adding a custom column is all that is happening.
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?
- ronrsnfld3 years agoSuper User
Why would you expect the outcome of a query to change if you don't change the query? Whether you accomplish this in the Advanced Editor, or in the Power Query User Interface is irrelevant.
When you followed the suggestion put forth by ppm1 and clicked on the #"Added Custom" step, what did you see? That is the formula to use if you are changing the query using the UI.
- ppm13 years agoSolution Sage
The 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