Forum Discussion

arvindyadav's avatar
arvindyadav
Post Partisan
9 years ago
Solved

Count Of Days In Month.

Hi All,   I need to count no of days in given month. i.e, How can I make a column or measure that will automatically go to the calendar of 2016 and input the number of days in the month. So basic...
  • arvindyadav's avatar
    arvindyadav
    9 years ago

    Hi ,

     

    DaysInMonthColumn=SWITCH(MONTH([Date]), 1, 31, 2, 29, 3, 31, 4, 30  
                   , 5, 31, 6, 30, 7, 31, 8, 31  
                   , 9, 30, 10, 31, 11, 30, 12, 31  
                   , BLANK() ) 

    The above formula is useful for me . I also want no of days in 5 months  . So how can I add those number.

     

    Regards,

    Arvind

  • v-jiascu-msft's avatar
    v-jiascu-msft
    9 years ago

    Hi arvindyadav,

     

    Would you like to try this formula as a calculated column?

     

    DaysInMonth =
    DAY ( EOMONTH ( [Date], 0 ) )

     

     

     

     

     

     

     

     

     

     

     

     

     

    Best Regards!

    Dale