Hi,
I have a table that gets daily refreshed from odatafeed and contains over 100.000 records. I want to duplicate this table, and create a selection to only load the last 2 weeks based on a creationdate of the records in the table, then each time when it gets refreshed it only loads the last 2 weeks.
How can I do this? 🙂
Solved! Go to Solution.
Hi @TechR21
Enter the following code into the formula bar to create a custom step. Replace "previous step name" with the previous step in your PQ. This will take Monday as the week start day.
= Table.SelectRows(#"previous step name", each [Date] < Date.From(Date.AddDays(DateTime.LocalNow(), -Date.DayOfWeek(DateTime.LocalNow(), Day.Monday))) and [Date] >= Date.From(Date.AddDays(DateTime.LocalNow(), -Date.DayOfWeek(DateTime.LocalNow(), Day.Monday)-14)))
Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.
Hello again,
here you go :
Please dont forget to accept it as a solution if it worked for you 🙂
Hello,
On power Query, right click on the table then press duplicate, then on the duplicated table, go to the date column and press on it, then choose dates filter and filter data that is in the last 2 weeks.
Please accept this as a solution if it helped you
I can only select last week or from a specific date, but that wouldnt work as it should not be from a specific date
and also i see it takes the weekstart as sunday instead of monday
Hi @TechR21
Enter the following code into the formula bar to create a custom step. Replace "previous step name" with the previous step in your PQ. This will take Monday as the week start day.
= Table.SelectRows(#"previous step name", each [Date] < Date.From(Date.AddDays(DateTime.LocalNow(), -Date.DayOfWeek(DateTime.LocalNow(), Day.Monday))) and [Date] >= Date.From(Date.AddDays(DateTime.LocalNow(), -Date.DayOfWeek(DateTime.LocalNow(), Day.Monday)-14)))
Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.
Power BI release plans for 2023 release wave 1 describes all new features releasing from April 2023 through September 2023.
Make sure you register today for the Power BI Summit 2023. Don't miss all of the great sessions and speakers!
User | Count |
---|---|
209 | |
52 | |
43 | |
41 | |
39 |
User | Count |
---|---|
269 | |
210 | |
73 | |
70 | |
65 |