Forum Discussion
afrutos
Resolver I
4 years agoFormula Switch
Hello good morning to all, I have a question about a formula, let's see if someone can help me. Thank you very much I am trying to create a measure in which, if I select with my selector the Gross ...
- 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
Resolver I
4 years agoHi, 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
ALLUREAN
Solution Sage
4 years agoRemove 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] )- afrutos4 years ago
Resolver I
Hi, thank you in advanced.
I made it, but still not working...This is getting me crazy.