Forum Discussion

_power_bi's avatar
_power_bi
Helper I
1 year ago
Solved

Power Query reading date as datetime datatype while using Direct Query

I have a very large table that I have to use direct query. The source is SQL Server. One of the fields is a datetime. When I connect to this source, it reads the field as datetime.  This doesn't work...
  • _AAndrade's avatar
    1 year ago

    Hi _power_bi,

    I will try one of this possible solutions:

    1 - When conecting to SQL server use a query like this:

    SELECT
        YourTable.*,
        CAST(YourDateTimeColumn AS DATE) AS NewDateColumn
    FROM YourTable


    2 - Add a Calcutated column using DAX and use it do make the realationship.