Arithmetic expression using Select()


I’m trying to make a Valid_if function to restrict the maximum value from another table. I have the following formula:

MAX(SELECT(GLOSARIO INVENTARIO[Máximo], AND([_THISROW].[Frecuencia] = [Frecuencia], [_THISROW].[Punto de venta] = [Lugar], [_THISROW].[Momento] = [Momento])))

It says the formula is ok but it is not a expected Valid If condition. Any thoughts?

Valid_if needs to evaluate to a TRUE/FALSE value. You can maintain this simply:

[_THIS]<=MAX(SELECT(GLOSARIO INVENTARIO[Máximo], AND([_THISROW].[Frecuencia] = [Frecuencia], [_THISROW].[Punto de venta] = [Lugar], [_THISROW].[Momento] = [Momento])))

It looks like the Select function is expecting a select-row? for the second parameter but you are providing AND which returns Yes/NO

Perfect! Worked great, thanks guys!

Can you please mark my reply as solution? It might be useful for other community members as well if and when they search the community posts with the solution tag. Thank you.

Done, sorry… didn’t knew there was a button for it. Thanks again!

Not a big deal, but you had marked your own reply :slight_smile:

Haha still so much to learn!