Forum Discussion

PowerrrBrrr's avatar
PowerrrBrrr
Icon for Helper III rankHelper III
4 years ago
Solved

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


  • Anonymous's avatar
    Anonymous
    4 years ago

    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)

     

    Best Regards
    Paul

     

9 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    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.

    • PowerrrBrrr's avatar
      PowerrrBrrr
      Icon for Helper III rankHelper III

      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

  • Anonymous's avatar
    Anonymous
    Not applicable

    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.

    • PowerrrBrrr's avatar
      PowerrrBrrr
      Icon for Helper III rankHelper III

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

  • Anonymous's avatar
    Anonymous
    Not applicable

    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

    • PowerrrBrrr's avatar
      PowerrrBrrr
      Icon for Helper III rankHelper III

      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

  • Anonymous's avatar
    Anonymous
    Not applicable

    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)

     

    Best Regards
    Paul