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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
rcmv
New Member

How to expand multiple table links on a query?

Hi folks!

I have the query below which is trowing me the following error: 

"(step 'SourceFinal5G') references other queries or steps, so it may not directly access a data source. Please rebuild this data combination."

The issue is related with the line:

 

 

#"Expanded Table Column1" = Table.ExpandTableColumn(#"Removed Other Columns1", "Transform File (4)", Table.ColumnNames(#"Transform File (4)"(#"Sample File (4)")))

 

 

By some reason it is giving a conflict when accessing the "Transform File (4)" column which contains the link to tables which contain data. 

transformFile.png

Any idea on how I can overcome this issue? I have already adjusted the Data Source Privacy Levels to none.

More details on the Query below:

 

 

 

let
    // Custom function to check if folder is empty:
    IsFolderEmpty = (folderPath as text) as logical =>
		// This function receives a parameter named folderPath of type text.
		// As logical is the return type of the function. 
		// The function will return a logical value (true or false) indicating whether the folder is empty or not.
		// => This arrow indicates the beginning of the function body. 
        let
            SourceF = Folder.Files(folderPath), // Use folderPath parameter here
            #"FilesCount" = Table.RowCount(SourceF),
            #"Verdade" = if #"FilesCount" > 0 then true else false
        in
            #"Verdade",
            
    // Define the folder path:
    NRReportFolder5g = #"NRReportFolder",

    // Check if folder is empty:
    FolderIsEmpty = IsFolderEmpty(NRReportFolder5g),

    // Load data if folder is not empty
    SourceFinal5G = if FolderIsEmpty = 0 then null else 
    (
         let
            Source1 = Folder.Files(NRReportFolder5g),
            #"Filtered Hidden Files1" = Table.SelectRows(Source1, each [Attributes]?[Hidden]? <> true),
            #"Invoke Custom Function1" = Table.AddColumn(#"Filtered Hidden Files1", "Transform File (4)", each #"Transform File (4)"([Content])),
            #"Renamed Columns1" = Table.RenameColumns(#"Invoke Custom Function1", {"Name", "Source.Name"}),
            #"Removed Other Columns1" = Table.SelectColumns(#"Renamed Columns1", {"Source.Name", "Transform File (4)"}),
            #"Expanded Table Column1" = Table.ExpandTableColumn(#"Removed Other Columns1", "Transform File (4)", Table.ColumnNames(#"Transform File (4)"(#"Sample File (4)")))
        in
            Source1
    )
in
    SourceFinal5G

 

 

 
1 REPLY 1
lbendlin
Super User
Super User

Inline the 

 #"Transform File (4)"

function into the current partition like you did with the IsFolderEmpty function

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors
Top Kudoed Authors