Arithmetic expression using Select()

Hi,

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?

@AlejandroCamacho
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!

@AlejandroCamacho
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!

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

Haha still so much to learn!