Forum Discussion

user01's avatar
user01
Resolver I
1 year ago
Solved

Create a measure that returns values like a Field Parameter does

I have some dummy data below. I imported the example from Excel, but the true data will come from SQL Server via DirectQuery.   I have a slicer for Category and a slicer for the Field Parameter. Th...
  • user01's avatar
    user01
    1 year ago

    Anonymous 
    I made a change to your code and it worked. But do you know why it did not work when I did it your way?

    SelectedValueMeasure =
    SWITCH(
        TRUE(),
        SELECTEDVALUE('Parameter'[Parameter Fields]) = "'Table'[Amount]", SUM('Table'[Amount]),
        SELECTEDVALUE('Parameter'[Parameter Fields]) = "'Table'[Employee]", SUM('Table'[Employee])
    )