cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

Cant save dataflow. One or more entities reference a dynamic datasource

Hi there,

I'm facing this problem to save my dataflow. I've tried all solutions listed bellow, otherwise the error persist.

Video Tutorials:

a): https://youtu.be/tnrFYZTLLUo and

b)  https://youtu.be/ZQ9T1SR9x9I
Power BI community similar erros:

a) https://community.powerbi.com/t5/Service/Fluxos-de-dados-Uma-ou-mais-entidades-fazem-refer%C3%AAncia...

b) https://community.powerbi.com/t5/Service/Error-when-saving-dataflow-quot-One-or-more-entities-refere...
c) https://community.powerbi.com/t5/Service/Erro-dados-din%C3%A2micos-PBI-Online-Service/m-p/1703413

d) https://community.powerbi.com/t5/Service/Erro-dados-din%C3%A2micos-PBI-Online-Service/m-p/1708491

e) https://community.powerbi.com/t5/Developer/can-t-save-dataflow-one-or-more-entities-references-a-dyn...

f) https://community.powerbi.com/t5/Service/Error-quot-Can-t-Save-Data-Flow-quot-One-or-more-entities/m...

 

Tutorials:
a) https://ssbipolar.com/2018/11/23/power-bi-dataflows-reuse-without-premium/
b) https://learn.microsoft.com/en-us/power-query/dataflows/best-practices-reusing-dataflows

c) https://medium.datadriveninvestor.com/setting-a-scheduled-refresh-on-a-dynamic-data-source-in-power-...

 

A brief summary about my code and environment.

1) I'm running this code into my Dataset and Dataflow. Both runs ok, but the error is launched when I try do save my dataflow.
2) I have a Power BI Premium per User Licence and the workspace where I'm trying to save the dataflow is Premium.

3) I'm trying to access a internal API so url is a 10.0.0.0:000 IP/Port address;

4) Access Token is retrieved by using a POST type of request and the authentication is by email/password;

 

Bellow is my code:

 

Function to get Access Token (ObterAccessToken):

 

(url as text) =>
let
    body = "{ ""email"": ""EMAIL_ADDRESS"", ""password"": ""PASSWORD""}",
    url = url,
    #"Retorno Json" = Json.Document(Web.Contents(url, [Headers=[#"accept"="application/json", #"Content-Type"="application/json-patch+json"], Content=Text.ToBinary(body), RelativePath = "/api/auth" ])),
    accessToken = #"Retorno Json"[accessToken]
in 
    accessToken

 

Function that connect to API and retrieve data (ConsultarIndicadores):

(url as text, accessToken as text, pagina as number) =>
let
    body = "{ ""page"": " & Text.From(pagina) & ", ""pageSize"":30}",
    authKey = "Bearer " & accessToken,
    dados = Json.Document(Web.Contents
        ("http://IP_ADDRESS:PORT", 
            [Headers=
                [#"accept"="application/json", 
                    #"Content-Type"="application/json-patch+json",
                    #"Authorization"=authKey
                ], 
                Content=Text.ToBinary(body),
                RelativePath = "/api/v1/items/list"
            ]
        )    
    )
in dados

 

Query that get token, request api data and combine the result into a table (QUERY_API):

 

let
  accessToken = ObterAccessToken(pUrl),
  // Carrega as páginas das consulta feita na API do SIGEST. Cada página é retornada e vira um item de uma lista.
  #"Listar Paginas" = List.Transform({1 .. Number.From(pQtdPaginas)}, each ConsultarIndicadores(pUrl, accessToken, _)),
  #"Convertido para Tabela" = Table.FromList(#"Listar Paginas", Splitter.SplitByNothing(), null, null, ExtraValues.Error),
  #"Column1 Expandido" = Table.ExpandListColumn(#"Convertido para Tabela", "Column1"),
  #"Column1 Expandido1" = Table.ExpandRecordColumn(#"Column1 Expandido", "Column1", {"code", "id", "polarity", "name", "bandCode", "startDateFormatted", "status", "unitOfMeasure", "type", "areaModel", "periodicity", "responsibles", "inputResponsibles", "classifications", "classifications2", "strategicTheme", "toleranceDaysOutdatedValues", "goalConsolidationType", "achievedConsolidationType", "formulas", "customFields", "values", "hasError"}, {"Column1.code", "Column1.id", "Column1.polarity", "Column1.name", "Column1.bandCode", "Column1.startDateFormatted", "Column1.status", "Column1.unitOfMeasure", "Column1.type", "Column1.areaModel", "Column1.periodicity", "Column1.responsibles", "Column1.inputResponsibles", "Column1.classifications", "Column1.classifications2", "Column1.strategicTheme", "Column1.toleranceDaysOutdatedValues", "Column1.goalConsolidationType", "Column1.achievedConsolidationType", "Column1.formulas", "Column1.customFields", "Column1.values", "Column1.hasError"}),
  #"Transformar colunas" = Table.TransformColumnTypes(#"Column1 Expandido1", {{"Column1.code", type text}, {"Column1.id", type text}, {"Column1.polarity", type text}, {"Column1.name", type text}, {"Column1.bandCode", type text}, {"Column1.startDateFormatted", type text}, {"Column1.status", type text}, {"Column1.unitOfMeasure", type text}, {"Column1.type", type text}, {"Column1.areaModel", type text}, {"Column1.periodicity", type text}, {"Column1.responsibles", type text}, {"Column1.inputResponsibles", type text}, {"Column1.classifications", type text}, {"Column1.classifications2", type text}, {"Column1.strategicTheme", type text}, {"Column1.toleranceDaysOutdatedValues", type text}, {"Column1.goalConsolidationType", type text}, {"Column1.achievedConsolidationType", type text}, {"Column1.formulas", type text}, {"Column1.customFields", type text}, {"Column1.values", type text}, {"Column1.hasError", type text}}),
  #"Substituir erros" = Table.ReplaceErrorValues(#"Transformar colunas", {{"Column1.code", null}, {"Column1.id", null}, {"Column1.polarity", null}, {"Column1.name", null}, {"Column1.bandCode", null}, {"Column1.startDateFormatted", null}, {"Column1.status", null}, {"Column1.unitOfMeasure", null}, {"Column1.type", null}, {"Column1.areaModel", null}, {"Column1.periodicity", null}, {"Column1.responsibles", null}, {"Column1.inputResponsibles", null}, {"Column1.classifications", null}, {"Column1.classifications2", null}, {"Column1.strategicTheme", null}, {"Column1.toleranceDaysOutdatedValues", null}, {"Column1.goalConsolidationType", null}, {"Column1.achievedConsolidationType", null}, {"Column1.formulas", null}, {"Column1.customFields", null}, {"Column1.values", null}, {"Column1.hasError", null}})
in
  #"Substituir erros"

 

Could any body help me here?

2 REPLIES 2
v-stephen-msft
Community Support
Community Support

Hi @trt18-sistemas ,

 

Did you mean you want to link entities between dataflows?

Maybe this document hleps you:

Link entities between dataflows - Power Query | Microsoft Learn

 

 

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-stephen-msft ,

 

Thanks for your reply. In that case I'm not linking entities, but using functions (which is a type of entitie, right?) that are at the same dataflow (their code are posted above).

My problem is that I can't save my dataflow. This dataflow, basically access a internal API. It first retrieve a token and use this token to authenticate and retrieve data from API.

 

Everything works fine. I can see the sampe data retrivied from the dataflow while I'm developing, but at the save moment, it launches the error "Can't save dataflow. One or more entities reference a dynamic datasource" (actually the message is in portuguese, but I'm freely translanting).
Many people has posted the same error, some of them has the same situation as mine. They are trying to retrieve data from a API and they could solve the problem, but their solution does'nt fit on me.


I really appreciate if you could help me here.

 

Regards

Helpful resources

Announcements
Carousel_PBI_Wave1

2023 Release Wave 1 Plans

Power BI release plans for 2023 release wave 1 describes all new features releasing from April 2023 through September 2023.

Power BI Summit Carousel 2

Global Power BI Training

Make sure you register today for the Power BI Summit 2023. Don't miss all of the great sessions and speakers!

Thank you 2022 Review

2022 Monthly Feature Releases

We had a great 2022 with a ton of feature releases to help you drive a data culture.

Top Solution Authors
Top Kudoed Authors