Forum Discussion
Creating a new Date Column based on multiple criteria
Hi,
I need to add SLA dates to a report, which change based on the severity and impact of the item logged, I have a table as below:
| Impact | Severity | Logged Date | SLA |
| A | 1 | 01/01/2023 | =Logged Date+2 months |
| A | 2 | 01/01/2023 | =Logged Date+2 months |
| A | 3 | 01/01/2023 | =Logged Date+2 months |
| A | 4 | 01/01/2023 | =Logged Date+2 months |
| B | 1 | 01/01/2023 | =Logged Date+9 months |
| B | 2 | 01/01/2023 | =Logged Date+9 months |
| B | 3 | 01/01/2023 | =Logged Date+9 months |
| B | 4 | 01/01/2023 | =Logged Date+9 months |
| D | 1 | 01/01/2023 | =Logged Date+9 months |
| D | 2 | 01/01/2023 | =Logged Date+9 months |
| C | 1 | 01/01/2023 | =Logged Date+12 months |
| C | 2 | 01/01/2023 | =Logged Date+12 months |
| C | 3 | 01/01/2023 | =Logged Date+12 months |
| C | 4 | 01/01/2023 | =Logged Date+12 months |
| D | 3 | 01/01/2023 | =Logged Date+12 months |
| D | 4 | 01/01/2023 | =Logged Date+12 months |
Would someone be able to help me work out how to add the SLA date based on the other 2 criteria?
- Anonymous3 years ago
Hi Anonymous ,
Please try to create a new column with below dax formula:
SLA = VAR _impact = [Impact] VAR _sev = [Severity] VAR _ld = [Logged Date] VAR _year = YEAR ( _ld ) VAR _month = MONTH ( _ld ) VAR _day = DAY ( _ld ) VAR _val = SWITCH ( TRUE (), _impact = "A", DATE ( _year, _month + 2, _day ), _impact = "B" || _impact = "D" && _sev IN { 1, 2 }, DATE ( _year, _month + 9, _day ), _impact = "C" || _impact = "D" && _sev IN { 3, 4 }, DATE ( _year, _month + 12, _day ) ) RETURN _valPlease refer the attached .pbix file.
Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
2 Replies
- lbendlinSuper User
Please describe the rules for considering impact and severity.
- AnonymousNot applicable
Hi Anonymous ,
Please try to create a new column with below dax formula:
SLA = VAR _impact = [Impact] VAR _sev = [Severity] VAR _ld = [Logged Date] VAR _year = YEAR ( _ld ) VAR _month = MONTH ( _ld ) VAR _day = DAY ( _ld ) VAR _val = SWITCH ( TRUE (), _impact = "A", DATE ( _year, _month + 2, _day ), _impact = "B" || _impact = "D" && _sev IN { 1, 2 }, DATE ( _year, _month + 9, _day ), _impact = "C" || _impact = "D" && _sev IN { 3, 4 }, DATE ( _year, _month + 12, _day ) ) RETURN _valPlease refer the attached .pbix file.
Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.