cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

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
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors