cancel
Showing results for
Did you mean:
Helper I

## Count Of days in Months (table)

Hi all,

I want to count the days in the month January, February, etc.

How can I make a column that will go to the calendar of 2020 and input the number of that month.

For example January 2020 – 31 days, February 2020-29 days.

I found a formula in the community but it doesn’t work for me:

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 table that I created shows the sales figures per month. I calculated the Days in Year with the COUNTROWS function.

Days in year = COUNTROWS(Kalender) and I was wondering if I could add something to count the days in a month?

Kind regards,

Clélia

1 ACCEPTED SOLUTION
Super User III

Hi @CleliaComes ,

You can try creating a calculated column as follows:

daysInMonth =
DAY ( EOMONTH ( ClothingSales[Date], 0 ) )

I tried it at my end and gives me the following result:

Thanks,

Pragati

If this helps, Appreciate a KUDOS!

Proud to be a Super User!

2 REPLIES 2
Helper I

Thank you very much it works!

Super User III

Hi @CleliaComes ,

You can try creating a calculated column as follows:

daysInMonth =
DAY ( EOMONTH ( ClothingSales[Date], 0 ) )

I tried it at my end and gives me the following result:

Thanks,

Pragati

If this helps, Appreciate a KUDOS!

Proud to be a Super User!

Announcements