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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Stroop
Frequent Visitor

Converting unixtime to date when importing

I am importing data from a MySQL database but because it's too large I am using a ODBC Impala connection which connects to the MySQL tables I need quickly. 

 

In the MySQL table I am using there is a timestamp field. However when connecting via Impala and uploading the full table this appears to be in a unixtime format (integer of how many seconds since 1970). 

 

This is the SQL I have entered when trying to upload for that field

 

select

dateadd(S,[TIME],'1970-01-01') AS DATE,

other column,

case statement,

count(other columns),

sum(other columns).....

group by ......

 

however Power BI does not recognise dateadd as a function and errors when running. 

 

I have also tried from_unixtime(time) too but I get the same error

 

Details: "ODBC: ERROR [HY000] [Cloudera][ImpalaODBC] (110) Error while executing a query in Impala: [HY000] : AnalysisException: Syntax error in line 2:
from_unixtime(TIME) AS DATE,
^
Encountered: DATE
Expected: DEFAULT, IDENTIFIER

CAUSED BY: Exception: Syntax error

 

 

Can anybody help?

1 ACCEPTED SOLUTION
v-yuezhe-msft
Microsoft Employee
Microsoft Employee

@Stroop,

Convert the timestamp field to datetime field in Query Editor or using DAX after you import the data to Power BI Desktop. For more details, please review the following similar thread.

https://community.powerbi.com/t5/Desktop/Converting-SAP-or-Unix-time-stamp/td-p/81628

Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-yuezhe-msft
Microsoft Employee
Microsoft Employee

@Stroop,

Convert the timestamp field to datetime field in Query Editor or using DAX after you import the data to Power BI Desktop. For more details, please review the following similar thread.

https://community.powerbi.com/t5/Desktop/Converting-SAP-or-Unix-time-stamp/td-p/81628

Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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