Quantcast
Channel: Service topics
Viewing all articles
Browse latest Browse all 62096

Date is casted as Datetime when filterin

$
0
0

Hello,

 

This was already asked 3 times before, in 2 cases the users found a workaround that didn't really fixed the issue in PowerBI.

I have a date field in the database (Azure SQL) and PowerBI, while doing a fitler on that field and using a direct query PowerBI is casting a dummy time stamp to a datetime field and comparing it into my date field.

 

I would like to have PowerBI using the date field as a date when filtering it.

Is there anything I can do from my side in order to resolve?

Or should this considered as a bug that should be fixed from Microsoft side?

 

This is impacting our performance alot.

 

See example below

SELECT TOP (1000001) [t1].[contenido_id], 
                     Count_big([t1].[id]) AS [a0] 
FROM   ((SELECT [$Table].[id]                  AS [id], 
                [$Table].[id_estadistica]      AS [id_estadistica], 
                [$Table].[accsub]              AS [accsub], 
                [$Table].[accls]               AS [accls], 
                [$Table].[accad]               AS [accad], 
                [$Table].[contenido_id]        AS [contenido_id], 
                [$Table].[contenido_numero]    AS [contenido_numero], 
                [$Table].[contenido_nombre]    AS [contenido_nombre], 
                [$Table].[contenido_plantilla] AS [contenido_plantilla], 
                [$Table].[contenido_orden]     AS [contenido_orden], 
                [$Table].[idioma]              AS [idioma], 
                [$Table].[recorrido_nombre]    AS [recorrido_nombre], 
                [$Table].[centro]              AS [centro], 
                [$Table].[fecha]               AS [fecha], 
                [$Table].[hora]                AS [hora] 
         FROM   [dbo].[powerbi_logs] AS [$Table])) AS [t1] 
WHERE  ( ( ( [t1].[centro] = N'XXXXXXXXXXX' ) 
           AND ( [t1].[fecha] >= Cast('20180527 00:00:00' AS DATETIME) ) ) 
         AND (( [t1].[contenido_plantilla] IN ( 
                N'Carrusel', N'Panoramica', N'Video' ) 
              )) ) 
GROUP  BY [t1].[contenido_id] 

 

- I don't want to change my table to Import mode like assigned 'resolved' here:
https://community.powerbi.com/t5/Desktop/DirectQuery-wrong-datetime-format-in-filter/td-p/99409

- I don't want to add an additional dummy datetime field to each date into my db, as 'resolved' here:

https://community.powerbi.com/t5/Desktop/Date-casting-on-DateTime-filter-using-Direct-Query/td-p/623619

- Couldn't find a real solution from PowerBI team here:
https://community.powerbi.com/t5/Desktop/Automatically-detect-date-versus-datetime/m-p/333201#M148997

 

Also, I've made sure that the field is assigned as a date in PowerBI and the database.


 

 


Viewing all articles
Browse latest Browse all 62096

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>