Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric certified for FREE! Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Incremental refresh with ID (YYYYMMDD)

Hi all

 

I wanted to try incremental refresh but got stuck since we use IDs for date related columns in our warehouse. I can't use the ID for the filtering with the two parameters RangeStart and RangeEnd.

In the documentation, a hint is provided that gives you a formula to convert from a Date/Time Value to an ID such as YYYYMMDD and it should be applied in the "filter step":

(x as datetime) => Date.Year(x)*10000 + Date.Month(x)*100 + Date.Day(x)


However, I can't even get to that filter step (which should let me select the parameters with the custom filter) if I don't even have a Date/Time column in my table. Am I missing something?
How do I set up a table for incremental refresh when I have an IdDay in the format of YYYYMMDD?

Thanks for the help!

 

1 ACCEPTED SOLUTION
Stachu
Community Champion
Community Champion

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))


Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

View solution in original post

6 REPLIES 6
Stachu
Community Champion
Community Champion

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))


Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

Anonymous
Not applicable

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

Anonymous
Not applicable

@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?

 

Stachu
Community Champion
Community Champion

#"Changed Type" was the name of the previous step in my mock up tableCapture.PNG
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



Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

Anonymous
Not 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!

Anonymous
Not 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

Helpful resources

Announcements
Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.