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
Anonymous
Not applicable

Help with filter one measure

Good morning,

 

hope you all are great.

 

I have a problem filtering one measure, wiosh you could help.

 

I have a table with data that is filtered by datestamps. For knowing which is the last date stamp is used the following:

 

 

 

lastdate = 
LASTDATE(airlift[phot_day_real])

 

 

 

That date is p.e. 22 - jan - 2021

 

I trying to filter the data like follows:

 

 

 

test_seats = 
CALCULATE(SUM(airlift[Seats]),
    FILTER(airlift,
        airlift[photo_day]=DATEVALUE([lastdate])))

 

 

 

but it doesn´t work....

 

But if I put the date manually it works perfectly, like this:

 

 

Total_seats = CALCULATE(
SUM(airlift[Seats]),
airlift[photo_day]=DATE(2021,1,22))

 

 

 

Can anyone help me with this¿?

 

Thanks!

 

Peter

1 ACCEPTED SOLUTION
AlB
Community Champion
Community Champion

Hi @Anonymous 

That is context transition working against you. Try:

test_seats =
VAR aux_ =
    DATEVALUE ( [lastdate] )
RETURN
    CALCULATE (
        SUM ( airlift[Seats] ),
        FILTER ( airlift, airlift[photo_day] = aux_ )
    )

Please mark the question solved when done and consider giving a thumbs up if posts are helpful.

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

Cheers 

 

SU18_powerbi_badge

 

View solution in original post

2 REPLIES 2
AlB
Community Champion
Community Champion

Hi @Anonymous 

That is context transition working against you. Try:

test_seats =
VAR aux_ =
    DATEVALUE ( [lastdate] )
RETURN
    CALCULATE (
        SUM ( airlift[Seats] ),
        FILTER ( airlift, airlift[photo_day] = aux_ )
    )

Please mark the question solved when done and consider giving a thumbs up if posts are helpful.

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

Cheers 

 

SU18_powerbi_badge

 

Anonymous
Not applicable

This is amazing!!! Thanks!!!! 😀

Helpful resources

Announcements
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!

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.

Top Solution Authors