Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

len on date field in table

Hi Experts

 

My next Appointmwnt date column in my FACT Table is of the format 25/12/2022 (dd/mm/yyyy) i wan to create a new column in the table where if the date is 25/12 and 01/01 then 1 else zero.

 

what is the dax please

  • HI Anonymous ,

     

    I think you mean OR instead of AND right?

     

    The formula would be:

    Formula = 
    
    IF(
        OR(
            DAY(DimDate[Date]) = 25 && MONTH(DimDate[Date]) = 12,
            DAY(DimDate[Date]) = 1 && MONTH(DimDate[Date]) = 1
        ),
        1,
        0
    )

     

    Result

     

     

    Best regards

    Michael

     

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

    @ me in replies or I'll lose your thread.

3 Replies

  • Mikelytics's avatar
    Mikelytics
    Icon for Resident Rockstar rankResident Rockstar

    HI Anonymous ,

     

    I think you mean OR instead of AND right?

     

    The formula would be:

    Formula = 
    
    IF(
        OR(
            DAY(DimDate[Date]) = 25 && MONTH(DimDate[Date]) = 12,
            DAY(DimDate[Date]) = 1 && MONTH(DimDate[Date]) = 1
        ),
        1,
        0
    )

     

    Result

     

     

    Best regards

    Michael

     

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

    @ me in replies or I'll lose your thread.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Excellent thank you for the feedback

  • Mikelytics's avatar
    Mikelytics
    Icon for Resident Rockstar rankResident Rockstar

    Aweseome! Thank you for your feedback1 🙂