Forum Discussion
Help with date filters
Hi Syndicate_Admin ,
As far as I know, DATESBETWEEN() will return a column instead a scalar value. However, measure need to be a aggregation value, so your measure will return error.
For reference: DATESBETWEEN
Returns a table that contains a column of dates that begins with a specified start date and continues until a specified end date.
This function is suited to pass as a filter to the CALCULATE function. Use it to filter an expression by a custom date range.
According to your statement, I think you want to return all taskdates in date range. Here I suggest you to create a table visual with taskdates, then create a measure as a visual level filter.
Filter =
IF (
MAX ( Tasks[TaskDate] )
IN DATESBETWEEN ( Tasks[TaskDate], [FechaDesde], [FechaHasta] ),
1,
0
)
In my sample, FechaDesde = 2022/10/21 and FechaHasta = 2022/11/01, TaskDate is whole 2022. Add this measure as a visual level filter and set it to show items when value = 1.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank you very much for your answer, I think this solution could work, I am trying to apply it but I am having a problem for having duplicate task dates, it tells me that this is not allowed:
Is there a way to fix it?