2 Replies Latest reply on Apr 17, 2018 6:12 PM by Daniel Oh

    Market share calculation - Difference between specific date

    Daniel Oh

      Hi all!


      I have question for creating measure - market share difference between specific dates.


      There is data for sales per each product & region & date.


      To calculate market share, I used level of detail as below

      SUM([Sales]) / Min({FIXED [Date],[Region] : SUM([Sales])})


      Result :


      And then to compare M/S Difference between 2018-01-04 vs 2018-01-01 I used 'If' function but tableau throw errors due to aggregation


      Expected Result - A : -27.0%  / B : 55.6% / C : -28.6%


      Under this situation, I tried to use 'ATTR" or any other solution(e.g. table calculation) but I can't get the perfect result.

      If I use Table Calculation(Lookup) and Index I can get expected result but I can't use table calculation as filter or sort to pick Top1 Product or Top1 Region.


      Please advice proper solution to solve 'date' - 'aggregation'