Forum Discussion

ArchStanton's avatar
ArchStanton
Power Participant
2 years ago
Solved

IF + AND Code

Hi,   I have the following code in a Calculated Column that I can't get to work. I would like to exclude anything created before 1st Apr 2021 and Resolved before applying the IF statement.   Day...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi  ArchStanton ,

     

    You can try the following dax.

    Complexity Bins =
    SWITCH (
        TRUE (),
        ISBLANK ( [Validation to Closure] ), BLANK (),
        [Validation to Closure] < 91.3,
            REPT ( UNICHAR ( 8203 ), 1 ) & "" & " 0-3 Mths",
        [Validation to Closure] < 182.5,
            REPT ( UNICHAR ( 8203 ), 2 ) & "" & " 3-6 Mths",
        [Validation to Closure] < 273.5,
            REPT ( UNICHAR ( 8203 ), 3 ) & "" & " 6-9 Mths",
        [Validation to Closure] < 365.25,
            REPT ( UNICHAR ( 8203 ), 4 ) & "" & " 9-12 Mths",
        [Validation to Closure] < 456.25,
            REPT ( UNICHAR ( 8203 ), 5 ) & "" & " 12-15 Mths",
        [Validation to Closure] < 547.5,
            REPT ( UNICHAR ( 8203 ), 6 ) & "" & " 15-18 Mths",
        [Validation to Closure] < 638.75,
            REPT ( UNICHAR ( 8203 ), 7 ) & "" & " 18-21 Mths",
        [Validation to Closure] < 730.5,
            REPT ( UNICHAR ( 8203 ), 8 ) & "" & " 21-24 Mths",
        [Validation to Closure] < 821.5,
            REPT ( UNICHAR ( 8203 ), 9 ) & "" & " 24-27 Mths",
        [Validation to Closure] < 912.5,
            REPT ( UNICHAR ( 8203 ), 10 ) & "" & " 27-30 Mths",
        [Validation to Closure] < 1004.5,
            REPT ( UNICHAR ( 8203 ), 11 ) & "" & " 30-33 Mths",
        [Validation to Closure] < 1095.5,
            REPT ( UNICHAR ( 8203 ), 12 ) & "" & " 33-36 Mths",
        REPT ( UNICHAR ( 8203 ), 13 ) & " 36+ Mths"
    )
    

     

    Best Regards,

    Liu Yang

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.