3 Replies Latest reply on Mar 16, 2016 7:21 AM by Derrick Austin

    Change measure values dynamically

    Pratik Rudra

      Hi ,

       

      My workbook has 2 filters From and To.

      Both the filters have exactly same values A,B,C and D

       

      My measure values contain 1,2,3,4

       

      I am pulling the measure values to rows shelf .

      My requirement is when I will provide filter values like below the measure value also automatically change in the rows shelf

       

        

      FromToMeasure Value
      AD1,2,3,4
      AB1,2
      AC1,2,3
      BD2,3,4

       

      Please let me know if it's possible and if so how?

      Thanks for your support

       

      Thanks,

        • 1. Re: Change measure values dynamically
          Derrick Austin

          Hey Pratik,

           

          Setup two parameter to switch between A/B/C and D. Then, create two calculated fields that returns the correct value based on the parameter selection.

           

          For example:

          CASE [ToParameter]

               WHEN 'A' THEN [A]

               WHEN 'B' THEN [B]

               WHEN 'C' THEN [C]

               WHEN 'D' THEN [D]

          END

           

          Hope this helps!

          - Derrick

          1 of 1 people found this helpful
          • 2. Re: Change measure values dynamically
            Pratik Rudra

            Thanks Derrick.

            Can you please explain how to change the number of selection in measure values by above approach.

            I want my rows shelf have dynamic number of values based on the selection.

             

            So I am taking measure values and want it to dynamically change its values everytime I change parameter values.

            • 3. Re: Change measure values dynamically
              Derrick Austin

              Ohhh, so [A] to [D] would also have [A], [B], and [C]?

               

              If so, you can combine with an if statement:

               

              IF [From] = 'A' AND [To] = 'D'

                   THEN [A] + [B] + [C] + [D]

              ELSEIF [From] = 'A' AND [To] = 'C'

                   THEN [A] + [B] + [C]

              ELSEIF [From] = 'A' AND [To] = 'B'

                   THEN [A] + [B]

              ...

              END

               

              You can, of course, combine these multiple ways - for example if you wanted to add commas between them and treat them like strings, maybe you need something like this:

              STR([A]) + " , " + STR([B])

               

              - Derrick