Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
jbobeck
Frequent Visitor

Filter not working with measure results

I have a report that is displaying a metric in two different time periods.  The base metric is just a COUNT and is connected to Between date slicer which is working perfectly.  I also need to display the same metric as a year to date count with the ending date equal to the second date in the slicer.  I've created a measure to pull the date selected using:

EndDate = LASTDATE('DimDate'[Date])

When I try creating a new measure to create the YTD I can't seem to get the proper functionality.  I've tried the following but Filter does not seem to work when passed the EndDate measure:

Measure= CALCULATE(
        COUNT('Table'[TableKey])
        , FILTER('DimDate', [Date] <= [EndDate]))

If I remove EndDate and hard code a date value it works.  Is there something I am missing?

1 ACCEPTED SOLUTION

Was able to get the measure to work, had to keep the visualization connected to the slicer and do the following;

MeasureYTD = 
VAR MaxDate = [EndDate]
RETURN
CALCULATE([BaseMeasure], ALL('FactTable'), 'DimDate'[YearToDateFlag] = TRUE, 'DimDate'[Date] <= MaxDate)

View solution in original post

3 REPLIES 3
HotChilli
Super User
Super User

I think using MAX instead of LASTDATE is what you need

Unfortunately using MAX doesn't change the reults, though it still does return the correct date value that matches LASTDATE.

Was able to get the measure to work, had to keep the visualization connected to the slicer and do the following;

MeasureYTD = 
VAR MaxDate = [EndDate]
RETURN
CALCULATE([BaseMeasure], ALL('FactTable'), 'DimDate'[YearToDateFlag] = TRUE, 'DimDate'[Date] <= MaxDate)

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.