Forum Discussion
Formula Switch
- 4 years ago
afrutos , can you try to print what is coming inside in MAX ( Selector[Selección] ) like below just to check whether it is going inside correct condtion or not.
Selección Detalle = IF ( ISCROSSFILTERED ( Selector[Selección] ), MAX ( Selector[Selección] ) )or try this:-
Selección Detalle = VAR selected_value = SELECTEDVALUE ( Selector[Selección] ) RETURN IF ( ISCROSSFILTERED ( Selector[Selección] ), SWITCH ( TRUE (), ISBLANK ( selected_value ), "Nada pte", selected_value = "Importe Bruto", [Bruto], selected_value = "Importe Neto", [Importe Neto], selected_value = "Base Imponible", [BI NOBLANK], [BI NOBLANK] ), [BI NOBLANK] )
afrutos , try like
SWITCH(TRUE(),
ISBLANK((Selector[Selección])),"Nada pte",
Max(Selector[Selección]) = "Importe Bruto", [Bruto],
Max(Selector[Selección]) = "Importe Neto", [Importe Neto],
Max(Selector[Selección]) = "Base Imponible", [BI NOBLANK] ,
[BI NOBLANK])
Hi, it gives me an error: A single value cannot be determined for the 'Selection' column in the 'Selector' table. This can happen when a measurement formula refers to a column containing many values without specifying an aggregation, such as min, max, count or sum, to obtain a single result
- ALLUREAN4 years ago
Solution Sage
Remove one of the double brackets
- afrutos4 years ago
Resolver I
I modifyed it, but still have the same text error
- Samarth_184 years ago
Community Champion
afrutos Small correction in your code. Please use like this:-
Selección Detalle = IF ( ISCROSSFILTERED ( Selector[Selección] ), SWITCH ( TRUE (), ISBLANK ( MAX ( Selector[Selección] ) ), "Nada pte", MAX ( Selector[Selección] ) = "Importe Bruto", [Bruto], MAX ( Selector[Selección] ) = "Importe Neto", [Importe Neto], MAX ( Selector[Selección] ) = "Base Imponible", [BI NOBLANK], [BI NOBLANK] ), [BI NOBLANK] )