cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Anonymous
Not applicable

No update from SQL Server

Hi everyone,

 

I am working with a database from SQL Server imported in Power BI Desktop with Direct Query, but I have problems updating my graphics.

 

In SQL Server I built a trigger so that, when I add a new row to my data, a statistic model is estimated. In my dataset I have a datetime variable and in Power BI I use it in a two-dimension table.

 

When I add a new observation with a new datetime, the trigger works but when I update my Power BI graphic the new observation with new datetime is not there. I don't understand why.

 

I tried with some easy examples and they worked. I imagine it is because the datetime I insert is not loaded as datetime but as a string, I tried to look for some solution but they were not good. How can I convert a string to a datetime? I know it's not difficult, but I am not able to convert it while giving it to my INSERT INTO command in SQL Server.

 

I hope I explained my issue well. Please ask for anything more.

 

Thank you in advance!!

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: No update from SQL Server

Hi nick93,

 

As you said, you are using power bi to connect to SQL Server database with direct query, but in direct query mode data model can't be changed so are you trying to connect to SQL Server database with some SQL Statement like "insert ... into ... " using query parameter? If so, you can use power query function 

DateTime.FromText(dateTime as nullable text, optional culture as nullable text) as nullable date 

to convert text to datetime format.https://msdn.microsoft.com/en-us/query-bi/m/datetime-fromtext.

 

Regards,

Jimmy Tao

 

 

 

View solution in original post

1 REPLY 1
Community Support Team
Community Support Team

Re: No update from SQL Server

Hi nick93,

 

As you said, you are using power bi to connect to SQL Server database with direct query, but in direct query mode data model can't be changed so are you trying to connect to SQL Server database with some SQL Statement like "insert ... into ... " using query parameter? If so, you can use power query function 

DateTime.FromText(dateTime as nullable text, optional culture as nullable text) as nullable date 

to convert text to datetime format.https://msdn.microsoft.com/en-us/query-bi/m/datetime-fromtext.

 

Regards,

Jimmy Tao

 

 

 

View solution in original post

Helpful resources

Announcements
Coming Soon: T-Shirt Design Contest

Coming Soon: T-Shirt Design Contest

Keep your eyes open for our upcoming T-shirt design contest!

Meet the 2020 Season 1 Power BI Super Users!

Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

Super User Challenge: Can You Solve These?

Super User Challenge: Can You Solve These?

We're celebrating the start of the New Super User season with our first ever Super User 'Can You Solve These?' challenge.

Power BI Desktop Update - February 2020

Power BI Desktop Update - February 2020

We are super excited for our update this month, as we are releasing two of our top community requests!

Power Platform Online Conference

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

Top Solution Authors
Top Kudoed Authors