6 Replies Latest reply on Jun 22, 2016 5:50 AM by Wildman .

    Change computation method with a parameter (filter)

    Wildman .

      I have a stacked bar diagram which contains multiple measures. I'm trying to create a parameter where I can select the computation of those measures. So when one selects in the parameter filter "Total" it will compute the measures with the SUM function and when I select "Per unit" it computes with the AVG function.

       

      I found the following solution if one uses only one measure the following works in a calculated field:

      CASE[Display Selection]

      WHEN "Total" then SUM([Measure name 1])

      WHEN "Per unit" then AVG([Measure name 2])

      END

       

      However how do I make this work when I have multiple measures? The command AND doesn't work.

       

      Thanks!

       

      P.s. I'm using Tableau 9.3.