Power Query - Append Variable Dates to Existing Table as Headers

alexb523

Board Regular
Joined
Dec 12, 2013
Messages
115
I am having an issue w/ my below M Code. I have set up an simple example of what i am trying to do below, but know the issue is when try to append variable dates as headers into the table:

Code:
let
Set up steps.
.
.
.
    #"Appended Query" = Table.Combine({#"Removed Other Columns",Table.PromoteHeaders(Table.Transpose(Table.FromList(List.Dates(Date.StartOfWeek(DateTime.Date(DateTime.LocalNow()),  Day.Sunday), 52, #duration(7,0,0,0)), Splitter.SplitByNothing(), {"Dates"}, null, ExtraValues.Error)),[PromoteAllScalars=true])})
in
    #"Appended Query"

Code:
Error:
Expression.Error: 2 arguments were passed to a function which expects 1.
Details:
    Pattern=
    Arguments=List


The table starts like table A. I use some simple query functions to get to this point. But I need to add the columns w/ dates and the function (Table A: Total Qty/50) for all added date columns as in Table B.

Table A
ProductTable A: Total Qty
a323000
b898807
c844945
d36330
e281009
f611092
g633217
Table B
ProductTable A: Total Qty6/4/20176/11/20176/18/20176/25/20177/2/20177/9/2017
a 323,000 6,460 6,460 6,460 6,460 6,460 6,460
b 898,807 17,976 17,976 17,976 17,976 17,976 17,976
c 844,945 16,899 16,899 16,899 16,899 16,899 16,899
d 36,330 727 727 727 727 727 727
e 281,009 5,620 5,620 5,620 5,620 5,620 5,620
f 611,092 12,222 12,222 12,222 12,222 12,222 12,222
g 633,217 12,664 12,664 12,664 12,664 12,664 12,664

<tbody>
</tbody>




Hope you can help! Thanks in advance!
Alex
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand

Forum statistics

Threads
1,215,087
Messages
6,123,050
Members
449,092
Latest member
ikke

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