Query Details

Per Solution Breakdown

Query

let _AuxiliaryTables = dynamic([
    "OfficeActivity", "AzureActivity", "Heartbeat",
    "SentinelHealth", "SecurityAlert", "SecurityIncident", "Operation"
]);
Usage
| where TimeGenerated > ago(30d)
| where IsBillable == true
| where DataType !in (_AuxiliaryTables)
| summarize 
    TotalGB = round(sum(Quantity) / 1024.0, 2),
    TableCount = dcount(DataType),
    DailyAvgGB = round(avg(Quantity) / 1024.0, 4)
    by Solution
| extend EstMonthlyCostUSD = round(DailyAvgGB * 30 * 2.76, 2)
| order by TotalGB desc

Explanation

This KQL query is designed to analyze data usage over the past 30 days, focusing on billable data types that are not part of a predefined list of auxiliary tables. Here's a breakdown of what the query does:

  1. Define Auxiliary Tables: A list of table names (OfficeActivity, AzureActivity, Heartbeat, SentinelHealth, SecurityAlert, SecurityIncident, Operation) is defined as auxiliary tables, which are not the focus of this analysis.

  2. Filter Data: The query filters the Usage table to include only records from the last 30 days (TimeGenerated > ago(30d)) and ensures that only billable data (IsBillable == true) is considered. It also excludes any data types that are in the auxiliary tables list.

  3. Summarize Data: For each solution, the query calculates:

    • TotalGB: The total gigabytes of data used, rounded to two decimal places.
    • TableCount: The distinct count of different data types.
    • DailyAvgGB: The average daily data usage in gigabytes, rounded to four decimal places.
  4. Estimate Monthly Cost: It estimates the monthly cost in USD by multiplying the daily average gigabytes by 30 days and a cost rate of $2.76 per gigabyte, rounding the result to two decimal places.

  5. Order Results: Finally, the results are ordered by TotalGB in descending order, showing the solutions with the highest data usage first.

In summary, this query provides insights into the data usage and estimated costs for different solutions, excluding certain auxiliary data types, over the past month.

Details

David Alonso profile picture

David Alonso

Released: April 8, 2026

Tables

Usage

Keywords

Usage

Operators

letdynamicinago>==!insummarizeroundsum/dcountavgbyextend*order bydesc

Actions