Forum Discussion
setis
6 years agoPost Partisan
First repeated occurence
Dear all, I'm working with the following travel table: As you can see, every travel has a unique pnrlocatorkey. Travels are usually return trips, as the 3 showed above. What I'm tryi...
- 6 years ago
Looks like the Travel_legs.firstleg and Travel_legs.lastleg will get you partly there.
Based on your suggestion, if you just want to see if the Departure and Arrival cities already exist earlier in the table, you could try:
UPDATED: Based on original poster's comments to reflect correct order of arrival and departure country.
TripReturn = COUNTROWS(FILTER(ALL(Travel), Travel[Departure Country] = EARLIER(Travel[Arrival Country]) && Travel[pnrlocatorkey] = EARLIER(Travel[pnrlocatorkey]) && Travel[Departure date] <= EARLIER(Travel[Departure date])))
setis
6 years agoPost Partisan
I managed to solve this switching Arrival country and departure country in the first line of the filter.
Thanks!
AllisonKennedy
6 years agoCommunity Champion
Thanks for the update setis
I will update my original post now so the solution looks more accurate. 🙂
I will update my original post now so the solution looks more accurate. 🙂