2 Replies Latest reply on Jun 21, 2018 12:51 AM by Shinichiro Murakami

    How to calculate part % between two txt reports

    Tunde Dozsa

      Hi guys,

      I have 2 txt file, where one report contains date/Product/expected sales data (A)

      Other file contains date/ product/Lost sales/root cause (B)

       

       

      How calculate root cause part %? I marked with yellow.

      I have one Power BI formula, but I don’t know, how write in Tableau

      BI formula: RC% = sum(lost_sales)/CALCULATE(sum(exp_sales);ALL(lost_sales))

       

      Do you know how to solve it?

       

      Thank you in advance

        • 1. Re: How to calculate part % between two txt reports
          Mavis Liu

          Hi Tunde.

           

          You'll need to create a blend between these data sources, after connecting to your first data source, go to the top and select new data source and connect to the second data source:

           

          2018-06-21_08h29_37.png

           

          Ont he top left you should now see two data sources:

           

          2018-06-21_08h29_50.png

           

          Start building out your view, by selecting which data source you want to start with. I started with data source B as it had all the columns I needed - data source B is now my primary data source which is indicated by a blue tick. Now I need to the exp sales from data source A, so I select data source A and bring Exp. Sales to the view.

           

          2018-06-21_08h30_38.png

           

          I then create the below calculation:

           

          2018-06-21_08h31_42.png

           

          Add this to the view and change it into a %:

           

          2018-06-21_08h31_54.png

           

          Then in the analytics pane, I find totals and bring it to the view and drag it over Column Grand Totals:

          2018-06-21_08h32_10.png

           

          The you get this final result:

           

          2018-06-21_08h32_19.png

           

          Thanks, please see the attached workbook.

           

          Mavis

          • 2. Re: How to calculate part % between two txt reports
            Shinichiro Murakami

            Hi Tunde

             

            Here is one simple example. ==> Sheet1

            Use Blend.

             

            Use Tale B as primary because it has lower level of granularity. (Root cause)

             

            Add one more data source of Table A and link with Date and Product (Blend)

             

             

             

            Or you can use Union + LOD in case you need to show 92.5% in the table together to add up to 100%. ==> Sheet2

            Union Your Data

             

             

             

             

             

             

             

            Thanks,

            Shin