Forum Discussion

isam2003's avatar
isam2003
Icon for Helper I rankHelper I
3 years ago

Change in Market Leader by City over Two Time Periods

Hello:  I am trying to create a visual that captures the market leader(highest revenue) across cities over two time periods.  The goal being to understand whether there has been a change in the leadership over the time periods under consideration.  


I have created two measures that split the revenues by time period 1 (Jan to April) and time period 2 (May to Sept).  I would like to use these measures to filter by city and by company to determine the market leader in each time period.  I would like to only capture the company that is the market leader in that city in time period 1 and time period 2.   

I would appreciate some assistance with creating this visual.  Thanks in advance. 

3 Replies

  • Thanks for your response, @Ibendlin.

    Sorry if I was not clear but what I am trying to do is move from the table on the left below to the table on the right. Thanks.

     

    • ppm1's avatar
      ppm1
      Icon for Solution Sage rankSolution Sage

      Here's a measure that shows one way to do it.

      BestCompany =
      VAR top1 =
          TOPN ( 1, ALLSELECTED ( T1[Company] ), CALCULATE ( SUM ( T1[Revenue] ) ), DESC )
      RETURN
          MINX ( top1, T1[Company] )

       

      Pat