Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
jaypatel
Helper III
Helper III

Get Data from Exiting Power BI Dataset using API

In Power BI, I have a dataset with data that resembles Access token data. When I click "Refresh Preview," it updates. Every API has an expiration date restriction. In a Power BI situation, I need to get information from an existing dataset.

I want to retrieve data from the "NewAt DS" main dataset and put it in the "MDDS" child dataset. I may use Power Query's ```Record.FromTable``` method to retrieve data from the main to the child. But every time it is used, it gets records and updates the main dataset (i.e. NewAT DS). To avoid that, I prefer to just retrieve a value from the dataset without refreshing it.

 

Can anyone help me with it?

 

jaypatel_1-1667285444422.png

 

Thanks, 
Jay

5 REPLIES 5
ImkeF
Community Champion
Community Champion

Hi @jaypatel ,
the refresh behaviour is how Power Query is designed and to my knowledge, cannot be changed:
Once you reference a query in the PQ editor, the referenced query will also be refreshed. Even if it is set to "Don't include in report refresh".
You could consider moving the "New ATDS"-query into a dataflow and reference that DF instead. That wouldn't trigger the refresh then

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

Hi @ImkeF , 

I tried to add DatwFlow to get the "NewAt DS" dataset value in it and use the same value in the Child dataset. However, I was able to refresh the dataset on the Power BI Desktop version. Once I published on to the Power BI Service and check in Data Source Credentials, it give me an unauthorized access error. I tried with "anonymous" credentials as there was on pop-up showing that when we use REST API as a data source we need to Sign In with an anonymous user.

Please help me with this.

 

And another thing to discuss is Why I was not able to set up Gateway for Dataflow? 

Screenshot 2022-11-08 162538.png

Thanks in Advance,

Jay

ImkeF
Community Champion
Community Champion

Hi @jaypatel ,
not sure I understand what's going on here.
But if you have staged some data in the dataflow, you should be prompted to authorize with your (organisational) Power BI account.
Anonymus auth wouldn't work, as that would mean that everyone could access your PBI dataflow.
Auth towards your API might be anonymus, but this would only be relevant when refreshing the (staging) dataflow and not during the dataset refresh.

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

v-xiaosun-msft
Community Support
Community Support

Hi @jaypatel ,

 

Could you tell us what your child dataset is? And I wonder whether you want to retrieve a value from the main dataset to update "child dataset" rather than "main dataset".

Please follow the following document.

How To Get Data From Power BI Dataset Via An API: EPCGroup

 

Best Regards,
Community Support Team _ xiaosun

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

@v-xiaosun-msft 
Thank you for the response.

I have "NewAT DS" as the Parent dataset and "MDDS" as the Child dataset. 
I have retrieved data using API and load into the dataset in the Parent dataset. However, here is a little different scenario to load data from parent to chid dataset without refreshing the Parent dataset value.

 

Thanks,

Jay

Helpful resources

Announcements
Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.