1
votes

I have 3 variables of interest:

  • City
  • Amount
  • Round: can take value of A or B

My dashboard is set such as each row represents a city, an in the column there is the amount. The amount column is divided in 2: Round A and Round B. (the user can see the amount for each round next to each other).

I am trying to create a filter or parameter that let's me see the Amount for round A and B next to each other or the sum of both. Currently, the filter allows me to see round A or round B or both next to each other. I want to also be able to see the sum.

I was advised to make a parameter this way (it does change anything):

  1. Right click on Round measure and create parameter. I added values from Round.
  2. Show Parameter
  3. Right Click on Round measure and create set. On the condition tab, by formula: [Round] = [Round Parameter]

Thanks (absolute beginner on Tableau)

enter image description here

1
So Your round A is jan 2020 to Nov 2020 and round B is upto Dec 2019+Dec2020? Am I Correct? Have you tried sub-totals from Analysis menu? Can you please include a screenshot of your dashboard or alternatively your book on tableau public and share a link, please?AnilGoyal
So I was asking about round field because the question was not clear earlier. See the answer, if I have correctly understood it now!AnilGoyal
@AnilGoyal thanks a lot! there seem to be an issue with the sum part (even in your GIF). I suspect it comes from the Rounds calculated field, the last line.Giuliano
Thanks for pointing it out. The error was in AMTS field. Now corrected, please checkAnilGoyal
Works perfectly! You've been very helpful, I'll use this way for other similar tasks I have as well. thanks!Giuliano

1 Answers

1
votes

I think you want something like this (see the GIF)

enter image description here

Proceed like this-

sample data taken

enter image description here

Step-1 create a parameter (say parameter 1) like this

enter image description here

Step-2 create two calculation fields with the following calculations-

ROUNDS with the following calculation

CASE [Parameter 1]
when 3 THEN [Round]
when 1 THEN (IF  [Round] = 'A' THEN [Round] end)
when 2 THEN (IF  [Round] = 'B' THEN [Round] end)
when 4 THEN 'Total'
END

Step-3 another calc field say AMTS as

CASE [Parameter 1]
when 3 THEN [Amt]
when 1 THEN (IF  [Round] = 'A' THEN [Amt] end)
when 2 THEN (IF  [Round] = 'B' THEN [Amt] end)
when 4 THEN [Amt]
END

STEP-4 Build the view using ROUNDS instead of round and AMTS instead of Amt, show parameter, click on NULL field when shown and EXCLUDE it. and you are done.

enter image description here