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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
PowerRon
Post Patron
Post Patron

Incremental refresh using datetime

Hello

 

we have a dataset whereby the rows contained a datetime field.
But because of the high cardinality we splitted this in a date and a time field.

We have to refresh this data on a daily basis. But for that we need a datetime field.
But then we create again the isssue of the high cardinality.

In the table we also have a day-key.

 

Do you always need a datetime field to do a refresh?
How to solve this problem?

 

Regards

Ron

1 ACCEPTED SOLUTION

Yes. That was your goal, to keep the cardinality low, right?

View solution in original post

9 REPLIES 9
PowerRon
Post Patron
Post Patron

Hmm, how does the casting work @lbendlin  ?
Not yet so experienced in Power Query and refresh

Knipsel.JPG

PowerRon
Post Patron
Post Patron

@lbendlin one more question. It is not possible to use just a Date field (so not a Datetime field) for RangeStart and RangeEnd?

regards
Ron

Sure. All you need is to cast your date field as datetime during the comparison  (basically pegging the time at midnight)

Hmm, how does the casting work @lbendlin  ?
Not yet so experienced in Power Query and refresh

Knipsel.JPG

Like so:

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMtU31DcyMDJUitUBcwyQeUYwXiwA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type date}}),
    #"Filtered Rows" = Table.SelectRows(#"Changed Type", each DateTime.From([Column1]) > RangeStart and DateTime.From([Column1]) <= RangeEnd)
in
    #"Filtered Rows"

 

How to use this code: Create a new Blank Query, then click on "Advanced Editor", and then replace the code in the window with the code provided here. Then click "Done".

 

lbendlin_0-1633522029047.png

 

great, thnx

lbendlin
Super User
Super User

Your RangeStart and RangeEnd parameters need to be DateTime, and they need to be used in the Power Query filter for the query/table that you want to implement incremental refresh for. 

 

But it doesn't really matter what they compare to.  So you could write a filter that says

 

DateValue+TimeValue > RangeStart and DateValue+TimeValue <= RangeEnd

Ok, so you then keep the date and time field as separate fields? Also when comparing to RangeStart and RangeEnd>

Yes. That was your goal, to keep the cardinality low, right?

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 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.

Top Solution Authors