Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
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.
User | Count |
---|---|
140 | |
113 | |
104 | |
77 | |
65 |
User | Count |
---|---|
135 | |
117 | |
101 | |
71 | |
61 |