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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
PowerrrBrrr
Helper III
Helper III

What's the alternative to use with Direct Query?

So I have table with [TimeStamp] in it and I have created a custom column with below formulae

=DateTimeZone.RemoveZone([TimeStamp])+#duration(0,3,0,0) ,

but this custom column was allowed in Import mode, when I do Direct Query I can't create one. How do I fix this in Direct query, which gives me same result as above code??


1 ACCEPTED SOLUTION
V-pazhen-msft
Community Support
Community Support

@PowerrrBrrr 

Of course you can do that in dax, you may create the measure in Direct Query mode.

 

Measure = MAX([DateTime])+TIME(3,0,0)

Vpazhenmsft_0-1634632695786.png

 

Best Regards
Paul

 

View solution in original post

9 REPLIES 9
V-pazhen-msft
Community Support
Community Support

@PowerrrBrrr 

Of course you can do that in dax, you may create the measure in Direct Query mode.

 

Measure = MAX([DateTime])+TIME(3,0,0)

Vpazhenmsft_0-1634632695786.png

 

Best Regards
Paul

 

V-pazhen-msft
Community Support
Community Support

@PowerrrBrrr 

 

Please make sure the TimeStamp column in your datasource is already Datetime type before connecting to Power BI. Direct Query doesn't support changing Text type date column to datetime type.

 

 

Paul

The timestamp column in Power Bi do show the Datetime format in Modelling tab , though it does not show the calendar icon beside the field name as a normal datetime field will show in normal table in Power Bi but i believe that is direct query feature and direct query do not support hirearchy.

I am looking if someone can confirm that with direct query I can create a measure to add time to a timestamp column from a direct query table

V-pazhen-msft
Community Support
Community Support

@PowerrrBrrr 

 

It is a custom column.

Vpazhenmsft_0-1634549286615.png

 

 

Paul

yeah.. but this you cant create with direct query

V-pazhen-msft
Community Support
Community Support

@PowerrrBrrr 
In this case you can just + 3 hours to the timestamp column. Direct Query just does not support the timezone function, which is not necessary.

=[TimeStamp]+#duration(0,3,0,0)

 

 

Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.

this is a measure what you have created ? I dont get the result when I create a measure.

V-pazhen-msft
Community Support
Community Support

@PowerrrBrrr 

I am afraid you can only switch the connect mode to import, this is a limitation of direct query. Is there any reason that you don't want to use import mode?

 

Use DirectQuery in Power BI Desktop - Power BI | Microsoft Docs

"To remedy the error, either delete the problematic step in Power Query Editor, or import the data instead of using DirectQuery."

 

 

Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.

its just we cant use import here, due to some limitation on data frequently changing. isnt there a way we can increase the hours in my timestamp field by 3 or 4 hours. thats all i need to change the time zone

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.