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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
Sept PBI Carousel

Power BI Monthly Update - September 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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

Top Solution Authors