Replace data according to the date

Faisal Yunianto

New Member
Joined
Apr 21, 2023
Messages
11
Office Version
  1. 365
Platform
  1. Windows
Hello guys, I had some power query case. I had dataset that contains a lot of rows and columns. For sample, in the table there is date and outlet user. I want to replace outlet user data according to the date that I want.

Example: in one column the outlet user are System Testing, Owner, etc. The date starts from first March, the outlet user is DANIEL. And then on March 7 the outlet user is NATHAN. And so on.

What I want is when the data start first March until March 6 the outlet user will replace into NATHAN. Start March 7 until the end of the data will replace into NATHAN.

I want to do dynamically in power query, because I can freely to change the name by needs. I appreciate who can solve this case. Thanks!

Note: actually there are thousands of data and dozens of files, so I using power query to make my work easier.
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Sorry i forgot to post the sample data.

1712045675261.png
 
Upvote 0
Where would be the logic of replacements?
In a table?
What's the logic behind your line
according to the date that I want.
 
Upvote 0
Where would be the logic of replacements?
In a table?
What's the logic behind your line
I imagine have table replacements like this, so i can dynamically control and input another date and user
1712221411623.png
 
Upvote 0
One easy way (100% UI-like)
Power Query:
let
    Source = Table.NestedJoin(Data, {"Date"}, replacements, {"Date"}, "replacements", JoinKind.LeftOuter),
    #"Expanded replacements" = Table.ExpandTableColumn(Source, "replacements", {"Outlet User"}, {"Outlet User.1"}),
    #"Filled Down" = Table.FillDown(#"Expanded replacements",{"Outlet User.1"})
in
    #"Filled Down"
 
Upvote 0
Solution
One easy way (100% UI-like)
Power Query:
let
    Source = Table.NestedJoin(Data, {"Date"}, replacements, {"Date"}, "replacements", JoinKind.LeftOuter),
    #"Expanded replacements" = Table.ExpandTableColumn(Source, "replacements", {"Outlet User"}, {"Outlet User.1"}),
    #"Filled Down" = Table.FillDown(#"Expanded replacements",{"Outlet User.1"})
in
    #"Filled Down"
Thanks Bro, it works!
1712379751195.png
 
Upvote 0

Forum statistics

Threads
1,215,219
Messages
6,123,689
Members
449,117
Latest member
Aaagu

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