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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
vani
Helper I
Helper I

MYSQL connection Date problem

I guys,

I have a power BI report which one of it's source is a MYSQL Database. 
The query has a field "created_at" which is a datetime field.

 

When iam refreshing the report sometimes power bi subtracts one hour to that field, sometimes it gave the correct value.

 

Have you guys face someting similar to this ? 

 

Any  problem with the connector ? 

 

Iam running out of ideas, please help.

 

 

1 ACCEPTED SOLUTION

@Anonymous it was a problem regarding the source database 😞 

 

The Connector is working fine 🙂 Thanks for the concern.

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

Its strange that  PBI is subtracting one hr from source data and it shoudlnt be. You say that sometimes it works correct, do you see any particular pattern when its manipulating date and when its pulling correct?

Hi @Anonymous,

 

There is my  M script on Power BI:

 

let
Source = MySQL.Database("xxxxxx", "xxxxxx", [ReturnSingleDatabase=true, Query="SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;#(lf)SELECT SO.id #(tab)#(tab) #(tab) #(tab)#(tab)#(tab)#(tab)#(tab)#(tab)#(tab)#(tab)#(tab)#(tab)as sale_id,#(tab)#(tab)#(tab)#(tab)#(tab)#(tab)#(tab)#(tab)#(tab)#(tab)#(tab)#(tab)#(tab)#(lf)#(tab) SO.identification #(tab) #(tab)#(tab)#(tab)#(tab)#(tab)#(tab)#(tab)#(tab)#(tab)#(tab)as sale,#(lf)#(tab) SO.created_at #(tab) #(tab)#(tab)#(tab)#(tab)#(tab)#(tab)#(tab)#(tab)#(tab)#(tab)as date#(lf)FROM orders SO#(lf)WHERE 1=1#(lf)AND SO.state_id in (2,4,5);#(lf)SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ ;#(lf)"]),

in
#"Source"

 

And then when i refresh the query several times on the query editor it has that strange behavior ( sometimes it has the correct result, others it retrieve date with one hour early). Same behavior its happening outside query editor.

Anonymous
Not applicable

Do you have sample data snapshot of

1. When its pulling correct data

2. When its subtracting 1 hr.

 

Basically am trying to understand in what scenrieo it happens.

 

Thanks
Raj

@Anonymous it was a problem regarding the source database 😞 

 

The Connector is working fine 🙂 Thanks for the concern.

Anonymous
Not applicable

Thanks for updating @vani

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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