Forum Discussion

afrutos's avatar
afrutos
Icon for Resolver I rankResolver I
4 years ago
Solved

Formula 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 ...
  • Samarth_18's avatar
    Samarth_18
    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]
        )