Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

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: 

 

ImpactSeverityLogged DateSLA
A101/01/2023=Logged Date+2 months
A201/01/2023=Logged Date+2 months
A301/01/2023=Logged Date+2 months
A401/01/2023=Logged Date+2 months
B101/01/2023=Logged Date+9 months
B201/01/2023=Logged Date+9 months
B301/01/2023=Logged Date+9 months
B401/01/2023=Logged Date+9 months
D101/01/2023=Logged Date+9 months
D201/01/2023=Logged Date+9 months
C101/01/2023=Logged Date+12 months
C201/01/2023=Logged Date+12 months
C301/01/2023=Logged Date+12 months
C401/01/2023=Logged Date+12 months
D301/01/2023=Logged Date+12 months
D401/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?

1 ACCEPTED SOLUTION
Anonymous
Not 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
    _val

vbinbinyumsft_0-1693273081983.png

Please 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.

View solution in original post

2 REPLIES 2
Anonymous
Not 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
    _val

vbinbinyumsft_0-1693273081983.png

Please 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.

lbendlin
Super User
Super User

Please describe the rules for considering impact and severity.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.