Ir al contenido

Los artículos de ayuda existen en alemán e inglés. Aquí los lees en inglés.

Informes, costes y exportación

How do I get my figures into Power BI or Excel?

With a Power Query query that loads your daily rows per channel and campaign through the read API; Power BI and Excel both understand the same query. You create the read key as a parameter, and the query sends it in the request header, never in the address. The read API comes with Growth, Scale and the agency plan.

Can I load my figures into Power BI or Excel and refresh them there?

Power BI and Excel fetch data through Power Query, and both understand the same query, written in the M language. The template below loads your account’s daily rows as a table with suitable column types. After that you refresh it like any other data source.

How to set it up

  1. 01In the portal, create a read key under “Exports & AI connections” in “API access”, ideally one just for this file.
  2. 02Open the Power Query editor with a blank query: in Excel via “Data > Get Data > From Other Sources > Blank Query”, in Power BI Desktop via “Home > Get data > Blank query”.
  3. 03Create the parameter MetrunioKey of type “Text” via “Home > Manage Parameters > New Parameter” and enter your key as its current value.
  4. 04Select the blank query, click “Advanced Editor”, replace its contents with the template below and confirm with “Done”.
  5. 05If Power Query asks how to access the web content, choose “Anonymous”. The query sends the key itself in the Authorization header, and Power Query only accepts that header with this kind of access.
  6. 06Load the table with “Close & Load” in Excel or “Close & Apply” in Power BI.

The template

// Metrunio: daily rows per channel and campaign, the last 30 days up to today.
// The key comes from the parameter MetrunioKey and never appears in the address.
let
    Response = Json.Document(
        Web.Contents(
            "https://api.metrunio.com/v1/data/daily",
            [Headers = [Authorization = "Bearer " & MetrunioKey, #"Accept-Language" = "en"]]
        )
    ),
    Rows = Table.FromRecords(
        Response[data],
        {
            "day", "channelName", "campaignName",
            "attributedConversions", "attributedRevenue", "postViewConversions",
            "unattributedConversions", "unattributedRevenue",
            "clicks", "impressions", "viewableImpressions", "cost"
        },
        MissingField.UseNull
    ),
    Typed = Table.TransformColumnTypes(Rows, {
        {"day", type date}, {"channelName", type text}, {"campaignName", type text},
        {"attributedConversions", type number}, {"attributedRevenue", type number},
        {"postViewConversions", type number}, {"unattributedConversions", type number},
        {"unattributedRevenue", type number}, {"clicks", Int64.Type},
        {"impressions", Int64.Type}, {"viewableImpressions", Int64.Type},
        {"cost", type number}
    }),
    Named = Table.RenameColumns(Typed, {
        {"day", "Day"}, {"channelName", "Channel"}, {"campaignName", "Campaign"},
        {"attributedConversions", "Attributed conversions"},
        {"attributedRevenue", "Attributed revenue"},
        {"postViewConversions", "Post-view conversions"},
        {"unattributedConversions", "Unattributed conversions"},
        {"unattributedRevenue", "Unattributed revenue"},
        {"clicks", "Clicks"}, {"impressions", "Impressions"},
        {"viewableImpressions", "Viewable impressions"}, {"cost", "Cost"}
    })
in
    Named

What the table contains

One row per day, channel and campaign for the last 30 days up to and including today, counted in your account’s time zone. Attributed conversions and attributed revenue follow your account’s default model, like the reports; clicks and impressions are measured. If a row’s cost stays empty, no cost was recorded for it. That is not the same as zero. Unattributed conversions sit in the row without channel and campaign.

Refreshing

  • Excel: “Data > Refresh All” fetches the figures again. In the query properties you can have Excel refresh when the file opens.
  • Power BI Desktop: “Refresh” on the Home ribbon.
  • Power BI service: for scheduled refresh, set the data source credentials to “Anonymous” and tick “Skip test connection”. Otherwise the service tests the connection without the key and gets a refusal.

Adjusting it

  • Period and model: in the Web.Contents call, add for example Query = [from = "2026-01-01", model = "linear"] next to Headers. Without an end, the period runs up to today; without a model, your account’s default model applies.
  • A query returns at most 50,000 rows. If it needs more, the API refuses instead of dropping rows; a shorter period helps.
  • When the API refuses, Power Query shows the status number. 401 means the key is missing, incomplete, revoked or expired. 403 means your plan does not include the read API or the account is not active. 422 means the period has too many rows or a setting is wrong.

Caution

The key is stored as a parameter in the file. Whoever gets the file gets the key, including anyone allowed to download a report from the Power BI service. Only pass the file to people who may know the key, or delete the parameter’s value first.

Note

In Excel and Power BI Desktop the figures stay in your file. If you publish the report to the Power BI service, they go to Microsoft and are processed under the terms of your contract with Microsoft. The rows are sums per day, channel and campaign and contain no identifiers of individual people.

Revisado por última vez el 15 oct 2026

En el portal del cliente

Go to exports & AI connections

También se pregunta

  • Connect Power BI
  • Load Metrunio figures into Excel
  • Is there a Power Query template?
  • Why does Power BI ask me to sign in?
  • Scheduled refresh in the Power BI service
  • How do I refresh the figures in Excel?

Artículos relacionados

  • How do I get my figures into Google Sheets?

    Can I pull my figures into a Google Sheets spreadsheet that updates itself every day?

    With a short Apps Script that fetches your daily rows per channel and campaign through the read API every morning and refills a sheet. You keep the read key in the script properties, not in the code and not in a formula. The read API comes with Growth, Scale and the agency plan.

  • How do I export data?

    Can I recalculate the numbers myself?

    Under “Exports & AI connections” you download CSV files for conversions, customer journeys and attribution by channel, with the same values the reports show, so you can recalculate them yourself. Conversions and journeys appear individually, row by row, and every row states the period, the environment and the time of the data.

  • How do I connect my own AI tool?

    Is there an MCP server for Metrunio?

    Through Metrunio’s MCP server. It exposes the same read tools as the portal chat. Claude and ChatGPT sign in via OAuth: you choose in the portal which account they may read. Other tools use an API key of scope “read”, the same one a script would use for /v1/data.

  • How do I rotate or revoke a key?

    What do I do if a key was published by accident?

    You renew the write key and the server key in “Setup”, the server key on the “Server Events API” tab, where you can also revoke it. Read keys are revoked under “Exports & AI connections”, in the “API access” section, where you also create a new one. A new key is shown in full only once, and the old one stops working immediately.

  • When does a day start in the reports?

    Which time zone do reports, the chat and the APIs use?

    A day runs from midnight to midnight in your account’s time zone; the default is Europe/Berlin, and you can change it under “Settings”. “The last 7 days” are seven whole calendar days including today, and a custom period includes its last day in full. The same rule applies to the overview, reports, costs, the chat, the MCP server and the read API.

  • How do the attribution models calculate?

    Which models exist and how do they distribute the share?

    There are seven models: six distribute a conversion by a fixed, disclosed rule, and the seventh reads the rule from your own paths. If a model finds matching touchpoints, it distributes the conversion’s full value across them; if it finds none, the conversion stays “unattributed” and is shown separately. Attributed and unattributed together add up to all conversions it calculates.

Mira lo que cuentan tus datos.

Echa un vistazo primero a la demo. Por ahora, solo hay cuenta propia con invitación.

Abrir la demoSolicitar acceso