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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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