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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
mmills2018
Helper IV
Helper IV

Issue with Date filter

 

Hello - can someone please help me out with the below, i received a reponse yesterday but unfortunately it did not solve my issue.

 

i have a slicer for Month/year, when i filter this slicer i am expecting my data to pull for the appropriate month selected.  Some of my data are measures with a date calculation (the date table is unrelated).  The issue I am running into, is that my data is only pulling YTD, so when i filter for June the data looks good but when i filter for May, it still keeps my June data.  below is my measure, any ideas what i am doing wrong?  I am assuming it has to do with a relationship of the filter?

 

 

Stage 4a Actual test =
var maxmonth= LASTDATE('Consolidated Talent Snapshot (2)'[Data as of])
return
CALCULATE(DISTINCTCOUNTNOBLANK('Consolidated Talent Snapshot (2)'[Associate ID]), 'Consolidated Talent Snapshot (2)'[In Talent for Job Family]="true", maxmonth)+0
 
 
****I tried using max instead of LASTDATE and received an error
1 ACCEPTED SOLUTION
AlexisOlson
Super User
Super User

It's rather odd to have a constant value as a filter in CALCULATE. Filter arguments should be tables or boolean conditions.

 

Maybe this will work more like you expect:

 

Stage 4a Actual test =
VAR maxmonth =
    LASTDATE ( 'Consolidated Talent Snapshot (2)'[Data as of] )
RETURN
    CALCULATE (
        DISTINCTCOUNTNOBLANK ( 'Consolidated Talent Snapshot (2)'[Associate ID] ),
        'Consolidated Talent Snapshot (2)'[In Talent for Job Family] = "true",
        'Consolidated Talent Snapshot (2)'[Data as of] = maxmonth
    ) + 0

View solution in original post

1 REPLY 1
AlexisOlson
Super User
Super User

It's rather odd to have a constant value as a filter in CALCULATE. Filter arguments should be tables or boolean conditions.

 

Maybe this will work more like you expect:

 

Stage 4a Actual test =
VAR maxmonth =
    LASTDATE ( 'Consolidated Talent Snapshot (2)'[Data as of] )
RETURN
    CALCULATE (
        DISTINCTCOUNTNOBLANK ( 'Consolidated Talent Snapshot (2)'[Associate ID] ),
        'Consolidated Talent Snapshot (2)'[In Talent for Job Family] = "true",
        'Consolidated Talent Snapshot (2)'[Data as of] = maxmonth
    ) + 0

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.