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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Table.TransformColumns(Source, {{"Item",  each _ ?? "OtherColumn" , type text}}) coalesces not work

Just testing some syntax in vs code 

 

why does this work 

let
    Source =   Table.FromRecords({
        [OrderID = 1, CustomerID = 1, Item = "Fishing rod", Price = 100.0, Shipping = 10.00],
        [OrderID = 2, CustomerID = 1, Item = null, Price = 5.0, Shipping = 15.00],
        [OrderID = 3, CustomerID = 2, Item = "Fishing net", Price = 25.0, Shipping = 10.00]
    }),
  ReplacedNulls = Table.TransformColumns(Source, {{"Item",  each if _ = null then "OtherColumn" else _, type text}})
in
    ReplacedNulls

but this doesnt. Using the power query sdk in vscode to test this. I thought the coalesces should work.  Just curious if the below works for others.
let
    Source =   Table.FromRecords({
        [OrderID = 1, CustomerID = 1, Item = "Fishing rod", Price = 100.0, Shipping = 10.00],
        [OrderID = 2, CustomerID = 1, Item = null, Price = 5.0, Shipping = 15.00],
        [OrderID = 3, CustomerID = 2, Item = "Fishing net", Price = 25.0, Shipping = 10.00]
    }),
  ReplacedNulls = Table.TransformColumns(Source, {{"Item",  each _ ?? "OtherColumn" , type text}})
in
    ReplacedNulls

Cheers 
8 REPLIES 8
Anonymous
Not applicable

Hi @Anonymous ,

 

Please be aware, Power Query SDK provides functionality related to the development and testing of Custom Connectors for Power Query and Power BI.

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

ZhangKun
Super User
Super User

Yes, the error message is:"token comma expected"(in vs). Maybe it's a bug? I think you can ask Microsoft or the plugin author.

Omid_Motamedise
Super User
Super User

Both are correct and work for me


If my answer helped solve your issue, please consider marking it as the accepted solution.
Anonymous
Not applicable

maybe its the vscode powerquery sdk 

Could you try it in VScode ? 

powerquery sdk in VSCode? Where do I get that??

Anonymous
Not applicable

Vs code extension you can download power query sdk extensions

Sorry. I do not have that tool.

ronrsnfld
Super User
Super User

Both work fine for me using Power BI Desktop

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.