Forum Discussion
Help with Date Filter needed
- 1 year ago
Hi ArchStanton,
First, create a base measure for Resolved Case Count:Resolved Case Count = CALCULATE( COUNT('Cases'[Case Number]), 'Cases'[statecode] = "Resolved", 'Cases'[Resolution Date] > DATE(2025,3,31) )Then, use TOTALYTD on top of this base measure:
YTD Closed Cases FINAL = TOTALYTD( [Resolved Case Count], ResolutionTable[Date], "31/03" )
Hope this helps !!If this post was helpful, please consider marking Accept as solution to assist other members in finding it more easily.
If you continue to face issues, feel free to reach out to us for further assistance!
Hi ArchStanton ,
The issue arises because you're using ResolutionTable[Date] in your TOTALYTD calculation, but the actual resolution dates of the cases are in the 'Cases'[Resolution Date] column. Unless there's an active one-to-many relationship between 'Cases'[Resolution Date] and ResolutionTable[Date], the date filter context won't propagate correctly, leading to duplicated April values. The measure that gave you correct results—YTD Closed Cases 3—works because it references the resolution date column directly but only works when a page-level filter is applied.
To solve this and remove the dependency on a page filter, modify the measure to embed the resolution date condition directly within the CALCULATE function. Use the version below to count only resolved cases with resolution dates after 31 March 2025, applying the correct year-to-date logic.
YTD Closed Cases Fixed =
CALCULATE(
TOTALYTD(
COUNT('Cases'[Case Number]),
'Cases'[Resolution Date],
"31/03"
),
'Cases'[statecode] = "Resolved",
'Cases'[Resolution Date] > DATE(2025,3,31)
)
If you need to continue using the calendar table for consistency, ensure there's an active relationship between 'Cases'[Resolution Date] and ResolutionTable[Date]. Then the following version will also work without requiring an external filter:
YTD Closed Cases Using Calendar =
CALCULATE(
TOTALYTD(
COUNT('Cases'[Case Number]),
ResolutionTable[Date],
"31/03"
),
'Cases'[statecode] = "Resolved",
'Cases'[Resolution Date] > DATE(2025,3,31)
)
This approach avoids duplicated values and gives you the correct output directly from the measure.
Best regards,
- ArchStanton1 year ago
Power Participant
Hi, thanks for your reply. The 'using calendar' measure give me the same duplication as before. Is there a way of writing this measure just using the TOTALYTD function with Year Ending "31/3"?
Also, the ResolutionTable has an active One to Many relationship with the Resolution Date in the Cases Table.- v-aatheeque1 year ago
Community Support
Hi ArchStanton,
First, create a base measure for Resolved Case Count:Resolved Case Count = CALCULATE( COUNT('Cases'[Case Number]), 'Cases'[statecode] = "Resolved", 'Cases'[Resolution Date] > DATE(2025,3,31) )Then, use TOTALYTD on top of this base measure:
YTD Closed Cases FINAL = TOTALYTD( [Resolved Case Count], ResolutionTable[Date], "31/03" )
Hope this helps !!If this post was helpful, please consider marking Accept as solution to assist other members in finding it more easily.
If you continue to face issues, feel free to reach out to us for further assistance!
- ArchStanton1 year ago
Power Participant
Thanks for this - much appreciated!