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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
DanaG
New Member

Separating a date/ time column to date column and time column without breaking query folding

Hi,
I am importing data from a postgres db.
I have a date/time column - which I would like to split into date column and time column.
I would like to implement incremental refresh and therefore trying not to break the query folding.
I can change the Data type of the column from data/time to date without breaking the query folding.

However all the approaches I have tried for the time column have broken the query folding.
Basically once I change the Data Type to Time - the query folding breaks.

Changing the Data Type in the model section didn't work as I wasn't able to establish a relationship with the time table.

Any suggestion how to make it work?

 

DanaG_1-1606795306382.png

 

Thanks

 

1 ACCEPTED SOLUTION
v-yingjl
Community Support
Community Support

Hi @DanaG ,

As far as I know, currently change the date type to time will not produce query folding in power bi.

Generally, the following list describes transformations that can be query folded.

  • Removing columns.

  • Renaming columns (SELECT column aliases).

  • Filtering rows, with static values or Power Query parameters (WHERE clause predicates).

  • Grouping and summarizing (GROUP BY clause).

  • Expanding record columns (source foreign key columns) to achieve a join of two source tables (JOIN clause).

  • Non-fuzzy merging of fold-able queries based on the same source (JOIN clause).

  • Appending fold-able queries based on the same source (UNION ALL operator).

  • Adding custom columns with simple logic (SELECT column expressions). Simple logic implies uncomplicated operations, possibly including the use of M functions that have equivalent functions in the SQL data source, like mathematic or text manipulation functions.

  • Pivoting and unpivoting (PIVOT and UNPIVOT operators).

 

If the last applied step broke the query folding, when you configure incremental refresh, you would see this warnning message:

incremental refresh.png

Not recommend but not forbidden that this incremental refresh could work but can cause incremental refresh to be very slow, and the process can run out of resources either in the Power BI service or in the on-premises data gateway if used.

Please refer: Query folding in incremental refresh 

 

Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
watkinnc
Super User
Super User

You can duplicate your DateTime column, and then change that column to type number. Then you can just format them as time once you load them. In DAX, you'd just wrap your column or measure in FORMAT(Table[Column], "h:mm:ss")

By making the DateTime decimal numbers, your time arithmetic becomes less complex as well.

--Nate


I’m usually answering from my phone, which means the results are visualized only in my mind. You’ll need to use my answer to know that it works—but it will work!!
mahoneypat
Employee
Employee

Once you get incremental refresh, how important does folding become?  In any case, you should be able to create your Date and Time columns as Calculated Columns (and use the DateTime column for incremental refresh).  In that case you still have the DateTime column adding unwanted size to your model.

 

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Thank you for your response Pat - I am a bit confused now.
I was trying to maintain query folding until the last applied step for the table I want to have incremental refresh on.
I can duplicate the date column without breaking the query folding - the step of changing the data type to Time that breaks the folding.
If I understand you correctly - does it mean that I can still implement incremental refresh even if the last applied step broke the query folding?
 
I can apply  data type changes in the Data model section (once the data was imported after the query editor) however the relationships don't seem to work - meaning data is not displayed in the visuals.

v-yingjl
Community Support
Community Support

Hi @DanaG ,

As far as I know, currently change the date type to time will not produce query folding in power bi.

Generally, the following list describes transformations that can be query folded.

  • Removing columns.

  • Renaming columns (SELECT column aliases).

  • Filtering rows, with static values or Power Query parameters (WHERE clause predicates).

  • Grouping and summarizing (GROUP BY clause).

  • Expanding record columns (source foreign key columns) to achieve a join of two source tables (JOIN clause).

  • Non-fuzzy merging of fold-able queries based on the same source (JOIN clause).

  • Appending fold-able queries based on the same source (UNION ALL operator).

  • Adding custom columns with simple logic (SELECT column expressions). Simple logic implies uncomplicated operations, possibly including the use of M functions that have equivalent functions in the SQL data source, like mathematic or text manipulation functions.

  • Pivoting and unpivoting (PIVOT and UNPIVOT operators).

 

If the last applied step broke the query folding, when you configure incremental refresh, you would see this warnning message:

incremental refresh.png

Not recommend but not forbidden that this incremental refresh could work but can cause incremental refresh to be very slow, and the process can run out of resources either in the Power BI service or in the on-premises data gateway if used.

Please refer: Query folding in incremental refresh 

 

Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors
Top Kudoed Authors