Dynamic count number of Days in a month up to Today

Hi All,

please can someone advice,

@Melissa has answered a similar question here: Dynamic count days

In a simplified version, what I’m trying to achieve is this, calculate:

No. of Hours worked * No of days in a month

Results in a bar chart.

The added “complexity” is that for the current month, it should ONLY use no of days up to Today instead of total no of days in that month.

so I would expect for:
July - 31
August - 31
September - 27 (because its the current month, and only 27 days in the month so far)

I have used this:

DAY(EOMONTH( TODAY(), 0 ))

but it doesn’t give me the right results.
I am displaying this on a bar chart.

Thanks

Hi @Ikay,

Give something like this a go, to determine the No of days in a month.

No of days in month = 
VAR CurrDay = TODAY()
RETURN
IF(
    CurrDay IN DATESMTD( Dates[Date] ), 
    DAY( CurrDay ),
    DAY( EOMONTH( MAX( Dates[Date] ), 0 ) )
)

I hope this is helpful.

1 Like

wow, thank you so much,