Forum Discussion
Incremental refresh with ID (YYYYMMDD)
- 8 years ago
basically you need to apply filter on IdDay, based on RangeStart & RangeEnd parameters
sample syntax:=Table.SelectRows(#"Changed Type", each [IdDay] >= Date.Year(RangeStart)*10000+Date.Month(RangeStart)*100+Date.Day(RangeStart) and [IdDay] < Date.Year(RangeEnd)*10000+Date.Month(RangeEnd)*100+Date.Day(RangeEnd))
Hi Stachu
Thanks! Where can I put this formula? Or in other words, where can I define a filter in PowerQuery according to that M formula? Do I need to go into the advanced editor?
Almomst there, thanks again.
Regards
Stachu
I answered it myself, there seems to be no other way than Advanced Editor. So I put in your formula:
#"Filtered Rows" = Table.SelectRows(#"Changed Type", each [IdDay] >= Date.Year(RangeStart)*10000+Date.Month(RangeStart)*100+Date.Day(RangeStart) and [IdDay] < Date.Year(RangeEnd)*10000+Date.Month(RangeEnd)*100+Date.Day(RangeEnd))
in
#"Filtered Rows"But PowerQuery gives me an error saying:
Expression.Error: The name 'Changed Type' wasn't recognized. Make sure it's spelled correctly.
Something wrong with the formula?
- Stachu8 years agoCommunity Champion
#"Changed Type" was the name of the previous step in my mock up table
you need to adjust it to whatever is the last step in your query
Also you don't need to go to Advanced editor, it's sufficient to press 'fx' = that will create a new step, and you can paste the formula there- Anonymous8 years agoNot applicable
Great! Now I got it to work.
Had to make sure the formula bar was actually enabled, otherwise there is no way to enter a formula.
Thanks for the help!- Anonymous7 years agoNot applicable
Hello
I understand how you use the non date field to put the filters in your Power Query and filter the data as per 2 parameters.
However, once you apply your changes and enable Incremental Refresh for your table, it does expect a datetime field, isn' it?
How did you handle that?
Regards