Forum Discussion
carogomez
5 years agoHelper I
Formulating in power query
Hi! I'm trying to formulate in power query the following issue: From a column called "Difference" and the day I am, I want to add a column in which it tells me If I "executed" the activity, "not ex...
- 5 years ago
Hi carogomez
Try this:
= if [Difference]=0 and [YTDfinal]<>0 then "Executed" else if [Difference]<0 and DateTime.Date(Date.Time.LocalNow())>[fechainicio] then "Extra executed" else if [Difference]>0 and DateTime.Date(Date.Time.LocalNow())>[fechainicio] then "Not executed" else if [Difference]>0 and DateTime.Date(Date.Time.LocalNow())<[fechainicio] then "Planned" else if [YTGfinal]>0 then "Planned" else "Unplanned"Not that M is case sensitive so if ... then... else has to be lower-case.
Please mark the question solved when done and consider giving a thumbs up if posts are helpful.
Contact me privately for support with any larger-scale BI needs, tutoring, etc.
Cheers
AlB
5 years agoCommunity Champion
Hi carogomez
Try this:
= if [Difference]=0 and [YTDfinal]<>0 then "Executed" else if [Difference]<0 and DateTime.Date(Date.Time.LocalNow())>[fechainicio] then "Extra executed" else if [Difference]>0 and DateTime.Date(Date.Time.LocalNow())>[fechainicio] then "Not executed" else if [Difference]>0 and DateTime.Date(Date.Time.LocalNow())<[fechainicio] then "Planned" else if [YTGfinal]>0 then "Planned" else "Unplanned"
Not that M is case sensitive so if ... then... else has to be lower-case.
Please mark the question solved when done and consider giving a thumbs up if posts are helpful.
Contact me privately for support with any larger-scale BI needs, tutoring, etc.
Cheers