How to find the billing of each cell in a notebook?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2025 02:12 AM
Suppose I have run ten different statements/tasks/cells in a notebook, and I want to know how many DBUs each of these ten tasks used. Is this possible?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2025 02:54 AM
Hey,
I really think this it’s not possible to directly determine the cost of a single cell in Databricks.
However, you can approach this in two ways, depending on the type of cluster you’re using, as different cluster types have different pricing models:
Using the cluster cost:
For all-purpose (interactive) clusters, Databricks charges per DBU/hour based on the instance type and autoscaling settings. You can estimate the cost by looking at how long the cluster was running while the cell was being executed and then calculating the cost based on the DBU rate.
For job clusters, costs are usually lower since you’re only charged for the duration of the job. If you’re using this type of cluster, you can break down the total cost based on the runtime of the job that includes the cell.
For serverless clusters, the cost is based on dynamically allocated resources, making it a bit trickier to estimate costs accurately. In this case, checking execution logs and usage metrics could help provide better insights.
Pricing calculator
Running the notebook as a job with System Tables enabled:
If you run your notebook as a job and have System Tables enabled, you can query the system.jobs_run_cost table to get the total cost of the job.
If you find this answer helpful, feel free to mark it as resolved or give it a 👍!
🙂

