title: Increment column for streaks
body: <p>How do I get the following result highlighted in yellow?
  <a href="https://i.stack.imgur.com/zPVKq.png" rel="noreferrer"><img src="https://i.stack.imgur.com/zPVKq.png" alt="enter image description here"></a></p>
  
  <p>Essentially I want a calculated field which increments by 1 when VeganOption = 1 and is zero when VeganOption = 0</p>
  
  <p>I have tried using the following query but using partition continues to increment after a zero. I'm a bit stuck on this one.</p>
  
  <pre><code>SELECT [UniqueId]
        ,[Meal]
        ,[VDate]
        ,[VeganOption]
        , row_number() over (partition by [VeganOption] order by [UniqueId])
    FROM [Control]
    order by [UniqueId]
  </code></pre>
  
  <p>Table Data:</p>
  
  <pre><code>CREATE TABLE Control
      ([UniqueId] int, [Meal] varchar(10), [VDate] datetime, [VeganOption] int);
  
  INSERT INTO Control ([UniqueId], [Meal], [VDate], [VeganOption])
  VALUES
  ('1', 'Breakfast',' 2018-08-01 00:00:00', 1),
  ('2', 'Lunch',' 2018-08-01 00:00:00', 1),
  ('3', 'Dinner',' 2018-08-01 00:00:00', 1),
  ('4', 'Breakfast',' 2018-08-02 00:00:00', 1),
  ('5', 'Lunch',' 2018-08-02 00:00:00', 0),
  ('6', 'Dinner',' 2018-08-02 00:00:00', 0),
  ('7', 'Breakfast',' 2018-08-03 00:00:00', 1),
  ('8', 'Lunch',' 2018-08-03 00:00:00', 1),
  ('9', 'Dinner',' 2018-08-03 00:00:00', 1),
  ('10', 'Breakfast',' 2018-08-04 00:00:00', 0),
  ('11', 'Lunch',' 2018-08-04 00:00:00', 1),
  ('12', 'Dinner',' 2018-08-04 00:00:00', 1)
  ;
  </code></pre>
  
  <p>This is for SQL Server 2016+</p>