Query Details
//Calculate the change in size of all your tables from last week to this week
//Data connector required for this query - query will automatically union any data you have
let lastweek=
union withsource=_TableName *
| where TimeGenerated > ago(14d) and TimeGenerated < ago(7d)
| summarize
Entries = count(), Size = sum(_BilledSize) by Type
| project ['Table Name'] = Type, ['Last Week Table Size'] = Size, ['Last Week Table Entries'] = Entries, ['Last Week Size per Entry'] = 1.0 * Size / Entries
| order by ['Table Name'] desc;
let thisweek=
union withsource=_TableName *
| where TimeGenerated > ago(7d)
| summarize
Entries = count(), Size = sum(_BilledSize) by Type
| project ['Table Name'] = Type, ['This Week Table Size'] = Size, ['This Week Table Entries'] = Entries, ['This Week Size per Entry'] = 1.0 * Size / Entries
| order by ['Table Name'] desc;
lastweek
| join kind=inner thisweek on ['Table Name']
| extend PercentageChange=todouble(['This Week Table Size']) * 100 / todouble(['Last Week Table Size'])
| project ['Table Name'], ['Last Week Table Size'], ['This Week Table Size'], PercentageChange
| sort by PercentageChange descThis query calculates the change in size of all tables from last week to this week. It uses a data connector to gather the necessary data. The query first retrieves the size and number of entries for each table from last week and stores it in a variable called "lastweek". Then, it does the same for this week and stores it in a variable called "thisweek". The two variables are then joined together based on the table name. The query calculates the percentage change in size between the two weeks and sorts the results by the percentage change in descending order. The final result includes the table name, size from last week, size from this week, and the percentage change.

Matt Zorich
Released: June 17, 2022
Tables
Keywords
Operators