Forum Discussion
PaulaL
7 years agoFrequent Visitor
increase date column based on conditions
Hi All, I am having some issues with how to approach my query so any help would be greatly appreciated. I have a date column that I need to increase based on two other columns values. e.g. Da...
- Anonymous7 years ago
PaulaL,
If you create a custom column in Power BI Desktop query editor, please use formula below.if [Impact] = "Urgent" and [LookUp] = "Stores" then Date.AddDays([DateReported],1) else if [Impact] = "Standard" and [LookUp] = "Floor" then Date.AddDays([DateReported],3) else null
If you create a calcualted column, please using DAX below.Column = if (and(SurveyCorrectiveAction[Impact] = "Urgent", SurveyCorrectiveAction[LookUp] = "Stores") ,SurveyCorrectiveAction[DateReported]+1 ,if(and(SurveyCorrectiveAction[Impact] = "Standard" , SurveyCorrectiveAction[LookUp] = "Floor" ), SurveyCorrectiveAction[DateReported]+3,BLANK()))
Regards,Lydia
Anonymous
7 years agoNot applicable
PaulaL,
If you create a custom column in Power BI Desktop query editor, please use formula below.
if [Impact] = "Urgent" and [LookUp] = "Stores" then Date.AddDays([DateReported],1) else if [Impact] = "Standard" and [LookUp] = "Floor" then Date.AddDays([DateReported],3) else null
If you create a calcualted column, please using DAX below.
Column = if (and(SurveyCorrectiveAction[Impact] = "Urgent", SurveyCorrectiveAction[LookUp] = "Stores") ,SurveyCorrectiveAction[DateReported]+1 ,if(and(SurveyCorrectiveAction[Impact] = "Standard" , SurveyCorrectiveAction[LookUp] = "Floor" ), SurveyCorrectiveAction[DateReported]+3,BLANK()))
Regards,
Lydia
PaulaL
7 years agoFrequent Visitor
AnonymousThank you very much for this, will it also work if I need to add multiple other impacts and departments? if I expand the else if?
- Anonymous7 years agoNot applicable
PaulaL,
It should work. If you get any issues using above formula, you can post back with sample data and expected result.
Regards,
Lydia