wildbisu
wildbisu

Reputation: 172

Azure Log Analytics - KQL - query for getting year-to-date count

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.

e.g current month-to-date dataset

monthly count

what I want the result to be is:

enter image description here

Upvotes: 0

Views: 524

Answers (1)

Slavik N
Slavik N

Reputation: 5328

The row_cumsum() function will do exactly what you're looking for.

Upvotes: 1

Related Questions