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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
otravers
Community Champion
Community Champion

Dataflows / PQO: query dependencies on other queries, parameters, functions?

A feature that I love in Power Query across Excel, Power BI Desktop, and Visual Studio, is that I can copy a query from one, paste it into the other, and all that queries dependencies will also get imported automatically, which might include:

 

- Other queries (think Append or Combine)

- Parameters (think API parameters, cloud file paths)

- Functions (think API call or a whole set of transformations)

 

With a single copy/paste action I might copy 12 different objects without having to even know about the underlying query dependencies.

 

I don't see any part of the Dataflow PQO experience where I could paste a query from the desktop tools. I don't think the workflow above is currently supported in the browser, but just in case, did I miss it? Right-clicking on the white space of the left pane in Edit Queries in PQO (my best guess as to where it would make sense that it works) doesn't show Paste (after copying a query from PQ in PBI Desktop):

 

pqo.png

 

Otherwise, will this be supported? It is fairly tedious and error-prone to have to recreate everything from blank queries.

 

Also, parameters and functions are not yet in PQO, are they?

 

EDIT: I posted this request, vote if you're interested!

https://ideas.powerbi.com/forums/265200-power-bi-ideas/suggestions/36184816-copy-paste-m-queries-wit...

------------------------------------------------
1. How to get your question answered quickly - good questions get good answers!
2. Learning how to fish > being spoon-fed without active thinking.
3. Please accept as a solution posts that resolve your questions.
------------------------------------------------
BI Blog: Datamarts | RLS/OLS | Dev Tools | Languages | Aggregations | XMLA/APIs | Field Parameters | Custom Visuals
7 REPLIES 7
yaronc
Power BI Team
Power BI Team

Hi @otravers,

 

You can use Get-Data and then choose blank query. There you can paste the M script from Power BI Desktop.

Another alternative is edit an existing M script by clicking on the right button on a query then choose 'Advanced editor'.

 

Hope that it helps.

 

Thanks,

Yaron

 

otravers
Community Champion
Community Champion

@yaronc I know, I mentioned starting from a blank query in my post. As I said that's not nearly as efficient as done a single copy/paste to get all dependencies imported in one swoop.

------------------------------------------------
1. How to get your question answered quickly - good questions get good answers!
2. Learning how to fish > being spoon-fed without active thinking.
3. Please accept as a solution posts that resolve your questions.
------------------------------------------------
BI Blog: Datamarts | RLS/OLS | Dev Tools | Languages | Aggregations | XMLA/APIs | Field Parameters | Custom Visuals

@otravers, finally got around to testing Dataflows. Pasted this simple dynamic EndDate parameter from Power BI to a blank query:

 

let
  Source = #datetime(Date.Year(Date.AddDays(DateTime.LocalNow(),-1)), Date.Month(Date.AddDays(DateTime.LocalNow(),-1)), Date.Day(Date.AddDays(DateTime.LocalNow(),-1)), 23, 59, 59)
in
  Source

and Dataflow insists on converting to a table before considering it "valid". Anyone know a workaround?

 

 

Thanks, DD

@musicbydannyd right click the name of the parameter in the PQO editor and uncheck Enable load before saving it, and this will no longer happen. Same thing with functions. They're both supported but not yet fully handled by the UI.

------------------------------------------------
1. How to get your question answered quickly - good questions get good answers!
2. Learning how to fish > being spoon-fed without active thinking.
3. Please accept as a solution posts that resolve your questions.
------------------------------------------------
BI Blog: Datamarts | RLS/OLS | Dev Tools | Languages | Aggregations | XMLA/APIs | Field Parameters | Custom Visuals

@otravers, that did the trick! Makes sense now, given loaded queries are converted to csv in Azure Gen 2...

 

Thanks so much, DannyD

You can now copy queries from Power BI desktop and then paste it into PQO in Power BI service. Take a look at this video: https://www.youtube.com/watch?v=YWp4FKzIBxM&feature=youtu.be

v-lili6-msft
Community Support
Community Support

HI, @otravers

I'm not familiar with Dataflow PQO, in power bi desktop or Excel, it could be achieved.

and for Dataflow PQO you may submit the post to there.

https://social.technet.microsoft.com/Forums/en-US/home?forum=powerquery

 

Best Regards,

Lin

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

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

Check out the February 2024 Power BI update to learn about new features.

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors
Top Kudoed Authors