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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! 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
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

July Power BI Update Carousel

Power BI Monthly Update - July 2026

Check out the July 2026 Power BI update to learn about new features.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors