MAXROW() With multiple filter conditions

Hello, I’m trying to refer to the last row based on several conditions instead of just one condition as the MAXROW() expression seems to allow.

My data looks something like this:

I need to get the last row (by row number) from table of Cities, where city is equal to _THISROW. [CITY] for example Kampala in this case, and [VISITORS] is blank, and [CHILDREN] is BLANK. i.e the formula should ignore rows, where the visitors and children columns are not blank.
In the above example the formula should return the highlited row where _THISROW.[CITY] = Kampala

I wrote this MAXROW() expression:

MAXROW(

“CITIES”, “_ROWNUMBER”,
(
[CITY] = [_THISROW].[KAMPALA],
ISBLANK([VISITORS]),
ISBLANK([CHILDREN])
)

)

Please help.

Thanks

1 Like

Have you tried packing the filters into one single condition?

MAXROW(

“CITIES”, “_ROWNUMBER”,

AND(
[CITY] = [_THISROW].[KAMPALA],
ISBLANK([VISITORS]),
ISBLANK([CHILDREN])
)

)

4 Likes

This worked like a charm! Thank you so much @perissf

2 Likes