Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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 @Tresor
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 @Tresor
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!!!! 😀
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
112 | |
100 | |
80 | |
64 | |
57 |
User | Count |
---|---|
146 | |
110 | |
93 | |
84 | |
67 |