# Analyse Costfluent cost in your BI tool or warehouse

By the end of this guide, Costfluent's cost data reaches the tool your analysts already work in: a spreadsheet, Power BI or Excel, your own data warehouse, or a script. It is for finance and for the data engineers who keep the company's reporting in one place. The path starts with choosing by need, then follows the steps of the path you chose; you rarely need more than one or two. Each step links to the page that owns the detail.

## Before you start

- A connection whose first collection has finished; see [Quickstart](/quickstart).
- Each path needs its own right: exporting a report, creating an API token, or adding a bucket destination. Each step's page names it under its **Before you start**; see [Access model](/concepts/access-model).
- Steps 2, 3 and 6 work on the [sample data](/quickstart#sample-data) a new organization starts with. No bucket export is sent from it, so steps 4 and 5 need a real connection.

## 1. Choose by need

| You need | Path | Step |
|---|---|---|
| One report's numbers in a spreadsheet, once | [Export to CSV or Excel](/cost-reports/explore#export-to-csv-or-excel) | 2 |
| A table in Power BI Desktop or Excel that you refresh | [Power BI and Excel](/developers/power-bi) | 3 |
| Every day's cost rows, as FOCUS 1.4 files in a bucket you own, for a warehouse or a data lake | [Bucket export](/developers/bucket-export) | 4 |
| A saved report's numbers, computed in your warehouse | [Copy SQL](/cost-reports/explore#copy-sql) over the bucket export | 5 |
| Cost data in your own code or pipeline | [SDKs](/developers/sdks) | 6 |

The export and the Power Query read what Costfluent counts, in the workspace's currency settings. The bucket export carries the bill's rows in their billing currency, with no conversion, so its totals can differ from a report that converts.

## 2. Export a report as CSV or Excel

Set up the report as you want it, open **Export** above the cost table, and choose **CSV** or **Excel** under **Costfluent columns** for Costfluent's native columns, or under **FOCUS 1.4 (FinOps standard)** for FOCUS column names. Choose the CSV when the figures must reconcile to the last digit, and **Excel** in a spreadsheet set to German, which misreads the CSV's separators. See [Export to CSV or Excel](/cost-reports/explore#export-to-csv-or-excel).

## 3. Load cost into Power BI or Excel

Create a token for the workspace from the **Read only** preset with only **View costs**, as [Create a token](/developers/power-bi#create-a-token) describes. Paste the page's query into a blank query in Power BI Desktop or Excel, connect to the API as an anonymous source, and load it; **Refresh** reads the latest cost again. The token is stored in the file in plain text, so keep the file where only the people allowed to see the cost can open it, and use a [service token](/api/authentication#service-tokens) for a report your team shares, so it keeps refreshing after you leave. See [Power BI and Excel](/developers/power-bi).

## 4. Deliver the cost rows to your bucket

Grant the export its one write permission, scoped to its folder in your bucket, as [Grant write access](/developers/bucket-export#grant-write-access) shows for each storage. Then open **Settings**, then **Workspaces**, select the workspace, and on the **Bucket export** card select **Add destination**. For a warehouse, choose Parquet under **File format** and turn on **Warehouse table**, so the folder also holds a Delta Lake table that always names the newest version of every day. Then select **Connect a warehouse** on the destination's row, choose your engine, and run the statement it shows, filled with your bucket, as [Warehouse table](/developers/warehouse-table) describes for each engine. See [Bucket export](/developers/bucket-export).

## 5. Write a saved report's query for your warehouse

Save the report, open **Export** above the cost table, and choose **Copy SQL**. Choose the **Warehouse** your table lives in and copy the query. It reads `focus_costs`, the name the statement of step 4 gives the table, so it runs as it is; in BigQuery, qualify it with your dataset. See [Copy SQL](/developers/warehouse-table#copy-sql) on the warehouse table page. A report using something the export does not carry, such as a segment, gets no query, and the dialog says why. See [Copy SQL](/cost-reports/explore#copy-sql).

## 6. Read cost from your own code

Use the Go, Python or TypeScript client for the Public API, with a token scoped to the workspace and the capabilities your script calls. The clients follow every page, retry what is safe to retry and keep amounts exact; read cost data from one state, so a sync that lands while you page cannot repeat or skip a row. See [SDKs](/developers/sdks), [Read cost data from one state](/developers/sdks#read-cost-data-from-one-state) and the [API reference](/api).

## Check the result

- The exported file holds the groups the report shows, under the column set you chose.
- After **Refresh**, the Power BI or Excel table shows the current month's cost so far.
- The bucket destination's row shows the day it is delivered through, and with **Warehouse table** on, its last commit.
- The query from **Copy SQL** runs in your warehouse against the registered table and returns the report's groups.

## Keep it true

Costfluent recommends checking the bucket destination's row whenever you review cost, since a destination that is behind or failing says so there. Replace a Power Query's or a script's token before its expiration, and revoke it under **API tokens** when someone who had the file leaves.

## From your assistant

With the [Costfluent MCP server](/developers/mcp) connected, your assistant answers these with `list_cost_reports` and `get_cost_report_sql`.

```text
Write the BigQuery SQL behind our saved report "Monthly cost by service" over the bucket export's columns, and tell me which table name to replace.
```

```text
Which settings of our saved report "Team showback" can the bucket export not express in Snowflake SQL, and why?
```

## Related

- [Export to CSV or Excel](/cost-reports/explore#export-to-csv-or-excel) and [Copy SQL](/cost-reports/explore#copy-sql)
- [Power BI and Excel](/developers/power-bi), [Bucket export](/developers/bucket-export) and [SDKs](/developers/sdks)
- [Close the month with finance](/guides/close-the-month-with-finance)
