Number of day between a month

Hi All
Trying to work out the number of days within a given period
Below function looks correct if the filter is on a year, either get 365, or 364.
However when i filter into Quarters the number does not look right.
Any suggestions please

Can you should the exact context you would like this results in, like how are you representing this calculation.

It’s very important here.

Thanks

just a KPI Card.
Im not putting into a context as such.

Calculation is being represented as a whole number.

There is always some context. For example the date slicer you are using is creating context for your calculation.

If you are literally just attempting to work out how many days are showing via a particular selection then all you should need to use is this;

Days In Context = COUNTROWS( Datestable )

That’s it