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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
armvoss
Helper I
Helper I

Trying to cut of seconds in datetime with direct query

Hello,

 

im new to Power BI. I have the following problem:

 

I use Direct Query to Connect to SQL Database. The Databasse contains 15 Instruments with the following information:

ID of Device

Measured Value

Datetime in Decimal of Taken Value

Timstamp in Integer

 

I nedd to cut of the Seconds in Order to Display the Values (if the secends differ the tooltip will not Display the values of all 15 instruments)

 

Change to Import is not an option. i already realised this scenario, is working fine. But i need the newst data if the customer opens the Dashboard. I cant use Split, Trunc, and several other Methods because they are not supported in direct query. 

I can change the View or how the Data is stored in the Database. But i would like to have a solution in Power BI without the change of the Database.

 

Any tips, tricks ideas would be appreciated.

 

Kind regards Armin

1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

multiply your datetime value by 1440, take the integer, divide by 1440.

View solution in original post

5 REPLIES 5
armvoss
Helper I
Helper I

The problem with the Dates not corresaponding the the dates in the database is gone. im not sure why it was there in the first place.

armvoss
Helper I
Helper I

Hello,

 

i have this problem: new power BI says there is data 2 days in the future.

 

Problemdirecttage.jpg

 

This is impossible. There can only be data until the current day. Because every hour there will be a measurement.

 

and there is no error in the database

 

Problemminutendatumsql.jpg

 

any ideas why this occurs?

You may want to open a new thread for this. Please provide more details - data source, transforms etc.  

 

 

lbendlin
Super User
Super User

multiply your datetime value by 1440, take the integer, divide by 1440.

thx for the answer. 

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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

Top Solution Authors
Top Kudoed Authors