Forum Discussion
Problem with DATESBETWEEN that has a variable inside
- 1 year ago
This is a lot to take in 😀.
I would start by creating 2 measures to return the desired start and end dates based on the slicer selection. You can then put these into a table / matrix visual and see what they are returning, and you can also use them within the YTD calculation. That will allow you to determine where the underlying issue is - either the calculation of the dates, or applying those dates as filters.
Once you've identified the problematic code, post the definition of the measure and a screenshot of the model relationships, ideally highlighting tables which are used for slicers so that we can get an overall picture of what is going on.
This is a lot to take in 😀.
I would start by creating 2 measures to return the desired start and end dates based on the slicer selection. You can then put these into a table / matrix visual and see what they are returning, and you can also use them within the YTD calculation. That will allow you to determine where the underlying issue is - either the calculation of the dates, or applying those dates as filters.
Once you've identified the problematic code, post the definition of the measure and a screenshot of the model relationships, ideally highlighting tables which are used for slicers so that we can get an overall picture of what is going on.
Hmm,
you pointed me in the right direction, it seems that a weird combination of related/unrelated tables with the combination of allowed/unallowed vizualisation cross filtering was causing the error.
(i kind of feel stupid rn)
I've been pulling whatever is left from my hair on this, thank you!