Forum Discussion

Ronald123's avatar
Ronald123
Resolver III
3 years ago
Solved

Switching Calculation with Field Parameters in Power BI Visuals

Hey Power BI community, I've noticed that since 2022, there's an option in Power BI to switch between calculations using field parameters. However, I'm currently working on a visual where I want...
  • MFelix's avatar
    MFelix
    2 years ago

    Hi Ronald123 ,

     

    Redo the measure to:

    Total Sum = 
    VAR _a =
        SELECTCOLUMNS ( Parameter, "Name",[Parameter])
    RETURN
        SUMX (
            _a,
            SWITCH (
                [Name],
                "APPEL", [APPEL],
                "ORANGE", [ORANGE],
                "BANANA", [BANANA],
                0
            )
        )
    

     

    I added a new row Banana to get some different results but it's working has needed: