Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi community!
Could you please help?
I am trying to add a custom column called [IndexKey] in Power Query to deliver the same outcome I have in a normal Excel table.
In a normal excel I have the following columns and values:
[PO number] (type as general) = 123456
[BillingDate] (type as short date) = 01/01/16
[CampaignName] (type as general) = Emirates is the best
When I use EXCEL CONCATENATE function I got "12345642370Emirates is the best" (this is exactly what I need as a kind of an index key)
Now jumping into Power Query, when I try this: [PO number] & [BillingDate] & [CampaignName] I got: "12345601/01/16Emirates is the best" (this is what I do NOT want).
I can imagine why this is happening (I think because of the special character &), but I want discover a way in which I could get the same outcome as Excel tables, but adding a custom column through user interface in Power Query.
Thanks again for your support.
Solved! Go to Solution.
Either convert your Date column to a Whole Number or create another column that just gets your Date column and switch it to a whole number, use that column instead of the original Date column in your concatenation.
Or, do it all in one column like this:
Column = CONCATENATE(CONCATENATE([PO Number],[Date]*1.),[Campaign])
If you have your data coming from excel sheets, You can convert the date format to number. Import this data to powerquery and change the data type of date column to Text.
In order to join them together in one column, data types of all the columns must be same. The "& " operator is similar to Excel in powerquery custom column.
If your data is not coming from excel, you can split the column in Query Editor and change the data type of all columns to text and then can be joined together.
If you have your data coming from excel sheets, You can convert the date format to number. Import this data to powerquery and change the data type of date column to Text.
In order to join them together in one column, data types of all the columns must be same. The "& " operator is similar to Excel in powerquery custom column.
If your data is not coming from excel, you can split the column in Query Editor and change the data type of all columns to text and then can be joined together.
Either convert your Date column to a Whole Number or create another column that just gets your Date column and switch it to a whole number, use that column instead of the original Date column in your concatenation.
Or, do it all in one column like this:
Column = CONCATENATE(CONCATENATE([PO Number],[Date]*1.),[Campaign])
Yes, it is one of those shorthand tricks you pick-up over time. Comes in handy.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
107 | |
94 | |
77 | |
63 | |
50 |
User | Count |
---|---|
147 | |
106 | |
104 | |
87 | |
61 |