title: Azure Log Analytics - KQL - query for getting year-to-date count
body: <p>I want to write a query in Azure Log Analytics to get month-to-date and year-to-date data for number of VMs. I already have a month-to-date table below. I want to use below to get year-to-date count against each month by simply adding count for all previous months.</p>
  <p>e.g current month-to-date dataset</p>
  <p><a href="https://i.stack.imgur.com/a3o6z.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/a3o6z.png" alt="monthly count" /></a></p>
  <p>what I want the result to be is:</p>
  <p><a href="https://i.stack.imgur.com/JjeBt.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JjeBt.png" alt="enter image description here" /></a></p>