Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
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
Solved! Go to Solution.
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
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
This is amazing!!! Thanks!!!! 😀
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.