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
Anonymous
Not applicable

Direct Query with Parameter Partition Error

Running into an issue setting up parameterized direct query in power query.  I currently have the power query advanced editor executing against the query below and it actually works in power query.  

 

 

 

let
    Results = 
    Text.Combine(
        {
            "
            select *
            from (
                select a.ID, a.NewValue, a.OldValue
                from sf.LH a
                join sf.L b on a.LeadId = b.Id
                where b.CAI = '", #"PARAM_Selected Account", "'
            
                union all
            
                select a.ID, a.NewValue, a.OldValue
                from sf.CH a
                join sf.C b on a.ContactId = b.Id
                where b.AI = '", #"PARAM_Selected Account", "'
            ) X
            "
        }
    ),
    Source = Sql.Database("X", "Y", [Query=Results])
in
    Source

 

 

 

I get an error however when I close and apply to make the changes back to the model below:

 

 

Failed to save modifications to the server. Error returned: 'DirectQuery partition 'LU_History-e698b91f-643c-4242-bb5c-8151a9911992' has '2' datasource reference(s) in its expression which is not allowed. '

 

 

 

Any thoughts into what causes this to fail when trying to commit back to the model and how to get the parameterized DQ configuration to function?

1 REPLY 1
v-kkf-msft
Community Support
Community Support

Hi @Anonymous ,

 

It works fine in my PBI Desktop. What is your version of Desktop?

 

Here are some similar threads, hope they help you.

 

Error on apply Power Query: Expression in partition n/a in table n/a references an unknown entity 

https://community.powerbi.com/t5/Desktop/Unable-to-delete-or-rename-Direct-Queries-due-to-new-error/td-p/1329364 

Behind the scenes of the Data Privacy Firewall 

 

Best Regards,
Winniz

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