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
BIanon
Helper V
Helper V

Transformation working fine in PQ but failing when loading in

Hello,

I have some pretty straight forwards M code:

let
    fetch_table_definition = "
select
  Purchase
from `project.dataset.table` 
where CustomerId = (
  select
    case
      when exists ( select 1 from `project.dataset.table` where CustomerId = "&Text.From( #"customer" )&" )
      then "&Text.From( #"customer" )&"
      else 0
    end
)
    ",
    Source = Value.NativeQuery(
        GoogleBigQuery.Database([BillingProject=#"BillingProject"]){[Name=#"project"]}[Data], 
        fetch_table_definition, 
        null, 
        [EnableFolding=true]
    ),
    Query = Source{0}[Purchase],
    EvaluatedResult = Expression.Evaluate(Query, #shared)
in
    EvaluatedResult

I'm simply fetching my M code, which includes a parametized sql query, from my DW and executing it.

Everything works fine in the preview, but when I try to load in the data, suddenly I'm getting this error on the query I'm trying to load in AND all params touching it:
Failed to save modifications to the server. Error returned: 'OLE DB or ODBC error: [Expression.Error] We cannot convert the value null to type Text.. '.


From this error message I don't even have a guess what I should be checking. It's also super weird that all of the params used suddenly throws the same error.

If one of the params was a wrong type (which they aren't, I've checked) the preview shouldn't be able to load. Queries sent to my DW also looks good.

Looking for any ideas about what I could try to do to troubleshoot this issue, happy to share more data if needed.

1 REPLY 1
lbendlin
Super User
Super User

If you have a Pro license you can open a Pro ticket at https://admin.powerplatform.microsoft.com/newsupportticket/powerbi
Otherwise you can raise an issue at https://community.fabric.microsoft.com/t5/Issues/idb-p/Issues .

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.