Hi,
I am struggling with Power Query in Excel.
I am trying to create a function to use in the spreadsheet.
My spreadsheet contains column headers with spaces in and therefore my query contains the same.
The problem seems to be that my query has spaces in there - if I change (Product name) to (Productname) then it works fine but I don't understand why this is and I would rather keep columns in the query named the same as the columns in the spreadsheet. Can I rewrite the below query so that it works by keeping the spaces in the column names?
let Category = (Product name) =><o></o>
<o></o>if (Product name) = "Car" then"Motorised"<o></o>
else if (Product name) = "Motorbike" then"Motorised"<o></o>
else if (Product name) = "Bicycle" then"Manual"<o></o>
else "Other"<o></o>
in Category<o></o>
I am struggling with Power Query in Excel.
I am trying to create a function to use in the spreadsheet.
My spreadsheet contains column headers with spaces in and therefore my query contains the same.
The problem seems to be that my query has spaces in there - if I change (Product name) to (Productname) then it works fine but I don't understand why this is and I would rather keep columns in the query named the same as the columns in the spreadsheet. Can I rewrite the below query so that it works by keeping the spaces in the column names?
let Category = (Product name) =><o></o>
<o></o>if (Product name) = "Car" then"Motorised"<o></o>
else if (Product name) = "Motorbike" then"Motorised"<o></o>
else if (Product name) = "Bicycle" then"Manual"<o></o>
else "Other"<o></o>
in Category<o></o>
Last edited: