Power Query - Column that Concatenates a column and a text version of a date.

jaihawk8

Board Regular
Joined
Mar 23, 2018
Messages
69
Office Version
  1. 2016
Platform
  1. Windows
I've got a PowerQuery that's currently set up and working great, with the exception of one thing. I need a column that Concatenates the Sales Rep's name and a text version of the date, so it can be picked up in another file. Currently, I have a column in the sheet where data is returned that has the following formula: =CONCATENATE(F2,"-",TEXT(T2,"mmddyyyy")), which gives me what I need.

The problem is that when I refresh the report for different payroll dates, if there are more rows than on the previous version, it doesn't carry the formula all of the way down. Currently I'm handling that as part of a macro, but I'd rather have it just come through from the PowerQuery itself.

Is that possible? I have tried to Add a column and use the formula =CONCATENATE([Sales Rep],"-",TEXT([Payroll Date],"mmddyyyy")). It says no syntax errors have been detected, but when I hit OK, I get the following error: Expression.Error: The name 'CONCATENATE' wasn't recognized. Make sure it's spelled correctly.

Is it possible to do this?
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
Since Power Query loads the table to an Excel table, you could essentially just add "=CONCATENATE([Sales Rep],"-",TEXT([Payroll Date],"mmddyyyy"))" to a new column and every time you refresh the table, that column will stay there. If you want to use Power Query you can do this:

Power Query:
[Sales Rep] & "-" & Date.ToText([Payroll Date], "MMddyyyy")
 
Upvote 0
Since Power Query loads the table to an Excel table, you could essentially just add "=CONCATENATE([Sales Rep],"-",TEXT([Payroll Date],"mmddyyyy"))" to a new column and every time you refresh the table, that column will stay there. If you want to use Power Query you can do this:

Power Query:
[Sales Rep] & "-" & Date.ToText([Payroll Date], "MMddyyyy")

Thanks! I will give that a try!!! I assume that is the coding that I would use in the Custom Column?
 
Upvote 0

Forum statistics

Threads
1,223,888
Messages
6,175,206
Members
452,618
Latest member
Tam84

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top