Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

DAX Power BI- Need a help on Formula

Dear All,   I would apprecaite, if you could help me to find an error in the formula below.   Month_Groups = SWITCH(TRUE(), AND(MYK_AD_20230428[Date_Month]<12),"Less than 12 Month",  AND(MYK_A...
  • Sahir_Maharaj's avatar
    Sahir_Maharaj
    3 years ago

    Hi Jelena,

     

    Thank you for your prompt response. Could you possibly please try the following:

    Month_Groups =
    SWITCH(
        TRUE(),
        MYK_AD_20230428[Date_Month] < 12, "Less than 12 Month",
        AND(MYK_AD_20230428[Date_Month] > 12, MYK_AD_20230428[Date_Month] < 24), "12-24",
        AND(MYK_AD_20230428[Date_Month] > 24, MYK_AD_20230428[Date_Month] < 36), "24-36",
        MYK_AD_20230428[Date_Month] > 36, "36+",
        BLANK()
    )

    Let me know if you might need further assistance.