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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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