Forum Discussion

Syndicate_Admin's avatar
Syndicate_Admin
Icon for Administrator rankAdministrator
2 years ago
Solved

error in DAX formula when segmenting production poor mes

Good afternoon I have this DAX formula to segment production by month: MesF = SWITCH( TRUE(), Table1[DATE] > DATE(2023,1,20& Tabla1 < DATE(2023,2,21), "February2023", Table1[DATE] > DATE...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi Syndicate_Admin ,

     

    You can modify your formula like below:

    MesF =
    SWITCH (
        TRUE (),
        MAX ( Table1[DATE] ) > DATE ( 2023, 1, 20 )
            && MAX ( Table1[DATE] ) < DATE ( 2023, 2, 21 ), "February2023",
        MAX ( Table1[DATE] ) > DATE ( 2023, 2, 20 )
            && MAX ( Table1[DATE] ) < DATE ( 2023, 3, 21 ), "March 2023",
        "Out of Range"
    )

     

    Best Regards,
    Adamk Kong

     

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