8 Replies Latest reply on Nov 9, 2018 7:58 AM by Paul Wachtler

    Using same measure value from different measures to filter

    Maciej Bedlin

      Hi All

       

      This is my first reach for help regarding Tableau so please correct me if I'm doing something wrong...

      to start with apologies but I can't share the workbook due to data sensitivity...

      I'm building a dashboard whee I have doughnut chart and bar chart using same values....so it is filtering nicely and each value (reason code) got its own color etc....

       

      Now I've been asked to add a table for all those values showing (top N and others)

      to achieve this I had to replace my reason code with calculated field

      IF [Expand or Collapse columns]="Collapse" THEN

      IF [PS Top N Reason by site1]

      THEN [PS_REASON_CODE_2]

      ELSE "Others" END

      ELSE [PS_REASON_CODE_2] END

       

      unfortunately since I've done this all collapsing nicely etc but I even though the table is using different reason codes I can't find a way to "merge" the filters...

      same reasons got different colors in the table and on the rest of the dashboard....

      and I am not able to filter the whole dashboard using the same reason code...

       

       

      any idea how could I go around it please?

        • 1. Re: Using same measure value from different measures to filter
          Naveen B

          Hi Maciej,

           

          Could you please add a sample workbook it will be easy to decipher the problem with the sample data and Required O/P

           

          BR,

          NB

          • 2. Re: Using same measure value from different measures to filter
            Paul Wachtler

            Hi Maciej,

             

            For the color, drop your calculated field onto color, set your parameter to "Expand" and then you should be able to set all the reason codes to manually match the color that they are for the rest of your dashboard.

             

            For the reason code filter, on your worksheet where you built your table, drop the original reason code field onto the filter pane and make sure it's set to use all values  That way the filter can be used across the whole dashboard.

             

            Let me know if you have any questions 

             

            Best,

            Paul

            • 3. Re: Using same measure value from different measures to filter
              Maciej Bedlin

              HI There is similar issue using sample superstore....

               

               

              as you can see below from second customer down colors don't match ( I can match manually but clicking on one sales value would not filter the other table...

              • 4. Re: Using same measure value from different measures to filter
                Paul Wachtler

                Hi Maciej,

                 

                Even though you presumably used Customer Name to create Customer Name Calc, because they're separate fields Tableau doesn't know that the colors should be the same between them.  Either manually set the color, or since the values are exactly the same, you may be able to color both by your Customer Name field to get the same colors for both.

                 

                To filter across both, you need to make sure both worksheets have the same filter on them.  In this case, I think you can place your Customer Name field as a filter on both worksheets and you'll be able to filter the way you want to.

                 

                Let me know if that works for you.  For your attached file, I'd need you to save it as a .twbx (Tableau Packaged Workbook) so that it brings your data over as well.  You can change the file type on the Save As screen under "Save as type:".  The .twb file doesn't include your data with it unfortunately.

                 

                Best,

                Paul

                • 5. Re: Using same measure value from different measures to filter
                  Maciej Bedlin

                  Hi Paul...

                  Either I'm doing it wrong or there is different solution...

                   

                  attached TBWX file.

                  If I drop customer on color on the collapsible table it will create extra set of numbers for each....

                  • 6. Re: Using same measure value from different measures to filter
                    Paul Wachtler

                    Hi Maciej,

                     

                    I was a little off in my original answer, but I got it working the way you want it in the attached file.

                     

                    Instead of using the Customer Name field as your color on both worksheets, you need to use the Customer Name calc field instead.  This will keep your colors consistent between the two worksheets, even if you increase your Top Customers 2 parameter.

                     

                    For the filter - since you're using the Customer Name field to limit the second worksheet to the Top customers, I created a copy of that field called Customer Name Filter.  I then put this on the filter pane in Sheet 1, right clicked on it, went to Apply to Worksheets and selected "All Using This Data Source".  That way it applies to both worksheets.

                     

                    I think that takes care of it for you.  Let me know if you have any questions.

                     

                    If your issue is solved, please mark this as the correct answer and select "Yes" on "This Helped Me" so that others can search for this completed thread in the future.

                     

                    Best,

                    Paul

                    • 7. Re: Using same measure value from different measures to filter
                      Maciej Bedlin

                      HI

                       

                      I would need to click Yes?No button

                       

                      Yes the filter works but if you take off the top 10 filtering from second (not collapsed) sheet all the names that are in "others" are under same color so I'm losing visibility to compare below 2 doughnut charts with and without your solution...

                      so the 318 value from second chart is all the others...... (colors changed due to proposed filter change so do not compare those based on color)

                      • 8. Re: Using same measure value from different measures to filter
                        Paul Wachtler

                        Right, the Customer Name field only works on the color the way you want when your Top customer filter is in there.  In the doughnut view, if you don't need the Top customer filter, then you should color both of those by Customer.

                         

                        It really depends on how you want your views set up - but coloring on Customer Name calc is necessary when you have that in your view.  If you don't, then use Customer Name color.

                         

                        Best,

                        Paul