Forum Discussion

msantos5's avatar
msantos5
New Member
7 months ago
Solved

Power BI REST API returns PowerBIEntityNotFound for dataset with upstream

I have two datasets, dataset A and dataset B, both in the same workspace. Dataset B uses dataset A as an upstream data source. I can execute queries via the API on dataset A, using the service pri...
  • mohit_sakhare's avatar
    7 months ago

    Hi,

    What you’re hitting is not a permissions problem — it’s a limitation of the ExecuteQueries REST API with composite / upstream models.

    Your Dataset B is PbixInCompositeMode and has upstreamDatasets (i.e., it’s a composite model that depends on another semantic model). In these scenarios, the ExecuteQueries REST endpoint can fail with “PowerBIEntityNotFound” even when the dataset exists and the caller is a workspace admin. This aligns with other reported cases where ExecuteQueries works for import models, but fails once a model becomes composite / DirectQuery over another semantic model.

    A few important points:

    • The ExecuteQueries API has several limitations (and service principal scenarios have additional limitations such as RLS/SSO restrictions).

    • Composite models introduce extra security/lineage requirements (permissions across all participating models) and, in practice, REST ExecuteQueries is not reliable/unsupported for composite models even though XMLA works.

    Recommended workarounds:

    1. Query Dataset A instead (the upstream/import model) via ExecuteQueries, since that’s the part the REST API supports reliably.

    2. Continue using the XMLA endpoint for Dataset B (since you confirmed it works) — XMLA is generally the more robust option for programmatic querying at scale.

    3. If you must use REST ExecuteQueries, consider restructuring so Dataset B is not composite (i.e., avoid “dataset over dataset” / upstream dependency).

    So, bottom line: Dataset B being a composite model with upstream datasets is the reason you’re getting PowerBIEntityNotFound via REST, while XMLA still succeeds.