Date query in Powerquery

ErsinALACA

New Member
Joined
Mar 6, 2020
Messages
31
Office Version
  1. 2019
Platform
  1. Windows
Sorry my english is not enough. I will explain it simply;

TableA;
TableA.PNG


TableB (Wanted)
TableB.PNG


Thanks for answers.
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
I think I found it
you've FillUp
but you don't have FillDown

it is hard to understand the language mix :cool:

Rich (BB code):
    #"Aşağı Dolduruldu" = Table.FillUp(#"Sıralanan Satırlar",{"Table2.Date"}),
    #"Filled Down" = Table.FillDown(#"Aşağı Dolduruldu",{"Table2.Date"}),
 
Last edited:
Upvote 0
Maybe it can be useful to friends. Table layout and codes exactly as follows;

VBA Code:
// TableA
let
    Source = Excel.CurrentWorkbook(){[Name="TableA"]}[Content]
in
    Source
    
// TableB
let
    Source = Excel.CurrentWorkbook(){[Name="TableB"]}[Content]
in
    Source

// Sorgu1
let
    Kaynak = Table.NestedJoin(TableA,{"Date"}, TableB, {"Date"}, "TableB", JoinKind.FullOuter),
    #"Değiştirilen Tür1" = Table.TransformColumnTypes(Kaynak,{{"Date", type date}, {"Price", type number}}),
    #"Genişletilen TableB" = Table.ExpandTableColumn(#"Değiştirilen Tür1", "TableB", {"Date"}, {"TableB.Date"}),
    #"Değiştirilen Tür" = Table.TransformColumnTypes(#"Genişletilen TableB",{{"TableB.Date", type date}}),
    #"Sıralanan Satırlar" = Table.Sort(#"Değiştirilen Tür",{{"Date", Order.Descending}}),
    #"Aşağı Dolduruldu" = Table.FillUp(#"Sıralanan Satırlar",{"TableB.Date"}),
    #"Özel Eklendi" = Table.AddColumn(#"Aşağı Dolduruldu", "Wanted :))", each if [Date] <> null and [TableB.Date]>=[Date] then [Price] else 0, type number),
    #"Filtrelenen Satırlar" = Table.SelectRows(#"Özel Eklendi", each ([#"Wanted :))"] <> 0)),
    #"Kaldırılan Yinelenenler" = Table.Distinct(#"Filtrelenen Satırlar", {"Part"}),
    #"Kaldırılan Sütunlar" = Table.RemoveColumns(#"Kaldırılan Yinelenenler",{"Date", "Price"}),
    #"Sıralanan Satırlar1" = Table.Sort(#"Kaldırılan Sütunlar",{{"Part", Order.Ascending}})
in
    #"Sıralanan Satırlar1"

tbl_Sell.PNG
 
Upvote 0
one more thing...
where is 20/03/2020 in your table (the bigger green) ?
DatePartPriceDateDatePartPricePartTable2.DateWanted :))
02/03/2020Part1320/03/202020/03/2020Part49Part128/03/20203
02/03/2020Part2528/03/202028/03/2020Part511Part228/03/20205
05/03/2020Part37Part328/03/20207
09/03/2020Part49Part428/03/20209
25/03/2020Part511Part528/03/202011
25/03/2020Part613Part628/03/202013
31/03/2020Part719
 
Upvote 0
My query works with a single date. You are right. I've realized now. Please; try this sample #26.
 
Upvote 0
but still don't see date: 20/03/2020
TableB
DatePartTable2.DateWanted :))
20/03/2020Part128/03/20203
28/03/2020Part228/03/20205
Part328/03/20207
Part428/03/20209
Part528/03/202011
Part628/03/202013
 
Upvote 0

Forum statistics

Threads
1,223,803
Messages
6,174,693
Members
452,577
Latest member
Filipzgela

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