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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

Top Solution Authors
Top Kudoed Authors