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

See when key Fabric features will launch and what’s already live, all in one place and always up to date. Explore the new Fabric roadmap

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
May PBI 25 Carousel

Power BI Monthly Update - May 2025

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

May 2025 Monthly Update

Fabric Community Update - May 2025

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

Top Solution Authors