Extracting ArcGIS Data Directly into Power BI and Icon Map Pro

Icon Map Pro already provides comprehensive support for ArcGIS feature layers, allowing them to be connected to your Power BI data model via data-bound layers. This works by matching a field from the ArcGIS feature layer to a corresponding field in your Power BI dataset.

That approach is reliable, but ArcGIS services often contain useful attribute data that you may also want to filter on, join to other tables, or use elsewhere in your report. To make that easier, we provide a Power Query function that can load ArcGIS feature service layers directly into Power BI, including aliases, domain values, and optional geometry handling.

This guide explains how to use ExtractandCombineEsriFeatureOAuthV2 to extract ArcGIS data from a Feature Service into Power BI. The function can:

  • Load all layers and tables from a Feature Service into one output table. When you include multiple layers (or several layer IDs via FilterLayers), their rows are unioned together—stacked in a single result with a shared column layout. The LayerName column tells you which ArcGIS layer or table each row came from.
  • Rename fields using ArcGIS aliases.
  • Optionally include geometry as WKT.
  • Optionally replace coded domain values with their readable labels.
  • Optionally limit the import to selected layer IDs.
  • Optionally authenticate with ArcGIS OAuth 2 using client_credentials.
  • Optionally convert point features into icon/image values for use in Icon Map.

After refresh, that data is stored in the Power BI semantic model. Report consumers use the published dataset in Power BI—they are not live-connected to ArcGIS as map viewers—so you often do not need extra ArcGIS Viewer-type licences for everyone who only opens the distributed report. That can deliver substantial cost savings and allow much wider distribution of the same maps and attributes. (Your organisation’s ArcGIS and Microsoft licensing terms still apply.)

This function is currently in preview. It has been tested against numerous example features, but we may not have covered every possible scenario. If you encounter any issues please reach out at support@tekantis.com


1. Initial Setup

Before starting, decide whether your ArcGIS service is public or secured.

If your Feature Service is public:

  • No OAuth setup is required.
  • You can invoke the function with just the service URL and any optional extraction settings.

If your Feature Service is secured:

  • Register an OAuth application in ArcGIS Online or ArcGIS Enterprise and obtain a Client ID and Client Secret. Follow the ArcGIS OAuth 2 documentation for the setup process.
  • If you are using ArcGIS Enterprise, note your portal URL. If omitted, the function defaults to https://www.arcgis.com.

Then:

  • Open Power BI Desktop and go to Transform data to open Power Query.
  • Add the ExtractandCombineEsriFeatureOAuthV2 function into your model (go to advanced view and copy and paste the M code across), or use a PBIX that already contains it. You can download the example: ArcGIS Feature Layer Extraction V2 (.pbix) — it includes the ExtractandCombineEsriFeatureOAuthV2 function ready to invoke.
  • If you are connecting to a secured service, store your ClientId, ClientSecret, and optional PortalUrl in parameters so they can be reused safely.

You are then ready to invoke the function.


2. Understanding Extraction Modes

ExtractandCombineEsriFeatureOAuthV2 can be used in several modes depending on how you want to work with ArcGIS geometry in Power BI and Icon Map Pro:

Mode What it Does When to Use It
Attributes Only Loads attribute data without WKT geometry. Best for very complex geometry where WKT may exceed Power BI's 30,000-character field limit. In this case you may still reference the feature layer using Icon Map Pro or ingest a GeoJson file as a data layer.
Attributes + WKT Geometry Loads attributes and adds a WKT column. Recommended when the geometry size is manageable and you want everything stored inside the Power BI model.
Points as Images For point layers, stores the renderer icon in WKT instead of point geometry and also adds Latitude and Longitude. Non-point features continue to use normal WKT. Useful when you want Icon Map Pro to render ArcGIS point symbology directly from the dataset.

3. Detailed Function Guide

ExtractandCombineEsriFeatureOAuthV2

Purpose: Extract one or more layers from an ArcGIS Feature Service into a single table, optionally including geometry, human-readable domain values, renderer-based point icons, and OAuth authentication.

How to use

Option 1 (recommended):

  • In Power BI Desktop, open Transform Data.
  • Select the function ExtractandCombineEsriFeatureOAuthV2.
  • Enter the required values in the invoke dialog.
  • Click Invoke.

Option 2 (Advanced users):

  • Create a new query using Get Data → Blank Query → Advanced Editor and enter:
let
    Source = ExtractandCombineEsriFeatureOAuthV2(
        "https://services.arcgis.com/.../FeatureServer",
        true,
        "medium",
        true,
        "0,1",
        false,
        null,
        null,
        null
    )
in
    Source

For a secured service:

let
    Source = ExtractandCombineEsriFeatureOAuthV2(
        "https://services.arcgis.com/.../FeatureServer",
        true,
        "medium",
        true,
        null,
        false,
        ClientId,
        ClientSecret,
        "https://your-portal.example.com"
    )
in
    Source

Parameters

Parameter Required Default Description
FeatureServiceUrl Yes None Base URL of the ArcGIS Feature Service.
IncludeGeometryWKT No true Adds a WKT column containing geometry in Well-Known Text format.
GeometryDetail No "low" Controls geometry precision. Supported values are "low", "medium", and "high".
ReturnDomainValues No true Requests readable domain labels instead of coded domain values where ArcGIS supports them.
FilterLayers No null Comma-separated layer IDs to include, for example "0,2,3". Leave blank to include all layers and tables.
PointsAsImages No false For point features with supported renderer symbols, writes the symbol image URL or data URI into WKT and adds Latitude and Longitude.
ClientId No null OAuth client ID. If omitted, the function makes unauthenticated requests.
ClientSecret No null OAuth client secret. Must be provided together with ClientId to enable secure calls.
PortalUrl No https://www.arcgis.com ArcGIS Enterprise or ArcGIS Online portal URL used for OAuth token requests.

Important behavior

  • OAuth is only used when both ClientId and ClientSecret are supplied and non-empty.
  • If PortalUrl is omitted, the function authenticates against ArcGIS Online.
  • The function requests tokens using the OAuth 2 client_credentials flow.
  • It loads both layers and tables returned by the Feature Service metadata.
  • Field names are renamed to ArcGIS aliases where aliases are available.
  • Paging: Large feature layers are handled automatically. The function pages requests using the service maxRecordCount (with a sensible default when missing) and keeps fetching until all features are retrieved, so you can load tens of thousands of rows per layer without splitting the job manually.
  • If PointsAsImages = true, the function still generates standard WKT for non-point geometries.
  • WKT is included whenever IncludeGeometryWKT = true or PointsAsImages = true.

Geometry detail levels

  • "low": Uses the smallest geometry precision and is best when you want to reduce WKT size.
  • "medium": A balanced option for most mapping scenarios.
  • "high": Preserves more coordinate precision at the cost of larger text values.

Output

The function returns one combined table (a union of every included layer or table). Use LayerName to filter, group, or slice by source layer when several are loaded together.

  • GeometryUID: A sequential unique ID added to every output row.
  • LayerName: The source ArcGIS layer or table name (identifies which layer each unioned row belongs to).
  • WKT: Geometry as Well-Known Text, or a point symbol image value when PointsAsImages is enabled.
  • Latitude and Longitude: Added when PointsAsImages = true for point layers.
  • All ArcGIS attributes, with aliases applied where available.

This makes the output especially useful for Icon Map Pro, where you may want to work with a single imported dataset rather than a live ArcGIS service connection—while benefiting from the semantic-model workflow and distribution advantages described above.