Count issue with a date measure is minor that date row

Hi,
I try to obtein the number of issues when the value “fecha de entrega” is minor that de date´s row.
image

I created a new measure like this, but doesn´t work.

NonZero(
Count(
Filter(
Descendants([Issue].CurrentHierarchyMember,[Issue].[Issue]),
Not IsEmpty([Measures].[Issue Fecha de entrega]) --custom field imported as property and filter
AND
[Measures].[Issue Fecha de entrega] <= [Time].DefaultMember --numeric measure for filter
)
)
)

Which is the error?
Thanks!
BR

Hi @jlopmor

Using MDX calculation, for operation with date, you may want to use specific functions; mathematical equivalences works with numbers only. For comparing dates, use function DateCompare() as described in documentation: https://docs.eazybi.com/eazybi/analyze-and-visualize/calculated-measures-and-members/mdx-function-reference/datecompare

Additionally, while [Measures].[Issue Fecha de entrega] most likely returns a date (if it is a property from date custom field), [Time].DefaultMember is a member, not date.
To get a date from a Time dimension member, you would use, for instance, function .StartDate (to get the first date from this time member), but it won’t work with [Time].DefaultMember. I am not sure what date you wanted to compare with Fecha de entrega date. Probably, [Time].CurrentHierarchyMember.StartDate (the start date of the selected time member)?

Filter condition:

DateCompare(
[Measures].[Issue Fecha de entrega],
[Time].CurrentHierarchyMember.StartDate
)<=0

would mean that issue Fecha de entrega is before or equal with the start date of the selected time period.

Best,

Ilze / support@eazybi.com