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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
David_Butcher
Regular Visitor

Syntax to use for a source query

I have a syntax question around a source query I'm trying to create.

I have a master query that connects to several company databases from Business Central and pulls back all the tables and when then I am using references against that query to pull out the data I need for the different companies.

 

So the Source Query looks like this 

David_Butcher_0-1710761375088.png

 

When referencing, I want to read from a single table but for all companies.

 

If I exclue the data from the query and just have a source pointing to the table object like this.  I can see the Company ID and Company Name.  If actually include the data element and write the source as = BCData{[Name="Projects_BI_PGS"]}[Data] or just expande the data as an additional step I lose the information about the company the data came from.

David_Butcher_2-1710761527298.png

Is there a way I can re-phrase this syntax = BCData{[Name="Projects_BI_PGS"]}[Data] to include the Company ID and Company against each record from the table?

 

P.S. I am aware I could do it in multiple steps referencing the data filtering to the table and expading the fields like this

 

let
    Source = BCData,
    #"Filtered Rows" = Table.SelectRows(Source, each ([Name] = "Projects_BI_PGS")),
    #"Expanded Data" = Table.ExpandTableColumn(#"Filtered Rows", "Data", {"No_", "Description", "Bill_to_Customer_No_", etc...})
in
    #"Expanded Data"

 

but I was looking for a more elegant solution.

1 REPLY 1
lbendlin
Super User
Super User

Power Query only supports dynamic sources if the eventual result (the table handed over to Power BI) has the same meta data structure.     Your premise seems to be far removed from that.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors