Forum Discussion
Anonymous
3 years agoNot applicable
Filter date table based on start and end date from another table's selected rows
Hi everyone. I've spent the last couple of hours trying multiple arpproaches to this simple problem, but can't seem to work it out. I will highlight what it is I need and mention the things I've trie...
- 3 years ago
So far, I'm able to project selected terms from pres_congres, whether contiguous or uncontiguous, to dji; but the performance of subsequent average calculation is terribly poor ... I'll leave it to you or others until I get some inspiration.
Alex_Sawdo
Resolver II
3 years agoThere's a slightly easier way to this sort of thing. What you could do is write two seperate measures, BeginDate and EndDate. BeginDate will be:
BeginDate =
VAR V_Start =
CALCULATE(
MIN([Start Service]
)
)
VAR V_End =
CALCULATE(
MAX(
[End Service]
)
)
RETURN
IF(
V_Start <= V_End,
V_Start,
V_End
)
And end date would be the inverse of this. Then, in your actual calculation you can do this:
CALCULATE(
[Your Thing To Calculate],
FILTER(
[Date Table],
[Date Column] IN
DATESBETWEEN(
[Date Column],
BeginDate,
EndDate
)
)
)
You would most likely need to have an inactive connection with your date table for this to work, but it should be able to accomplish your goal.
You would most likely need to have an inactive connection with your date table for this to work, but it should be able to accomplish your goal.