cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results for 
Search instead for 
Did you mean: 

Costs from cost managem azure portal are not allligned with costs calculated from usage system table

vziog
New Contributor II

Hello,
the costs regarding the databricks service from cost management in azure portal (45,869...) are not allligned with costs calculated from usage system table (75,34). 

The costs from the portal are filtered based on the desired period (usage_date >='2025-04-11') and the resource group where the workspace resides:

Azure Databricks      Azure Databricks             Premium All-purpose Compute DBU           45,8694226916667

this is the query i am using which gives 75,34:

%sql
SELECT u.workspace_id
  ,u.sku_name
  ,p.pricing.default
  ,u.usage_date
  ,usage_start_time
  ,usage_end_time
  ,usage_quantity
  ,((unix_timestamp(usage_end_time) - unix_timestamp(usage_start_time))/3600) * usage_quantity*p.pricing.default as costs
  ,usage_quantity*p.pricing.default as costs2
FROM system.billing.usage u
  left join system.billing.list_prices p on u.sku_name=p.sku_name

WHERE
 
  u.workspace_id='xxxxxxxxxxxxx'
 
  and p.price_end_time is null
  and u.usage_date >='2025-04-11'
  and p.sku_name='PREMIUM_ALL_PURPOSE_COMPUTE'
2 REPLIES 2

Alberto_Umana
Databricks Employee
Databricks Employee

Hi @vziog,

The Azure portal typically aggregates costs from various billing categories (such as DBUs, infrastructure, storage, and networking) based on usage logs and pricing. On the other hand, the query designed by you extracts detailed cost estimates solely based on DBU usage from the system.billing.usage and system.billing.list_prices tables. There may be costs missing in your query, such as:

 

  • Infrastructure costs for virtual machines, storage, or networking.
  • Any applicable Azure service fees or extra charges (e.g., premium features or non-resource-specific costs).

 

vziog
New Contributor II

Hello @Alberto_Umana

thank you for your answer. The thing is that this could explain the discrepancy if the costs from the query where less than the costs management but now are more. Thats why i find it strange.

Join Us as a Local Community Builder!

Passionate about hosting events and connecting people? Help us grow a vibrant local community—sign up today to get started!

Sign Up Now