cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

{Direct Query} Change to Timeformat and Rounddown to nearest.

hi everyone,

I have an data output in my sql table in number format, when trying to calcuate the differentiate output comes in number format but output required is below.

 

11.35 to 11:21 and should rounddown to 11:00

11.65 to 11:39 and should rounddown to 11:30

12:00 to 12:00 and should not rounddown to 12:00

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User II
Super User II

Re: "Direct Query" Switch to Time Format and Round to Nearest.

Hello @askspepsi ,

If I got your logic correctly, try the following forms in new columns:

Half hour = 
ROUND('Table'[Value] / 24 * 48,0) / 48 

Desired Output = 
IF(
    MINUTE('Table'[Value] / 24) <= 30 , 
    ROUND('Table'[Value] , 0 ) / 24 , 
    ROUND('Table'[Value] / 24 * 48 , 0 ) / 48
)

10-08-_2020_17-27-03.png

Greetings FrankAT

View solution in original post

4 REPLIES 4
Highlighted
Super User IX
Super User IX

Re: {Direct Query} Change to Timeformat and Rounddown to nearest.

@askspepsi , check if you can create a column suggested in this post

https://community.powerbi.com/t5/Desktop/Round-up-time-to-next-hour/td-p/701404



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

Helper I
Helper I

Re: {Direct Query} Change to Timeformat and Rounddown to nearest.

@amitchandak 

this is in time format where i cann't change.

Highlighted
Super User II
Super User II

Re: "Direct Query" Switch to Time Format and Round to Nearest.

Hello @askspepsi ,

If I got your logic correctly, try the following forms in new columns:

Half hour = 
ROUND('Table'[Value] / 24 * 48,0) / 48 

Desired Output = 
IF(
    MINUTE('Table'[Value] / 24) <= 30 , 
    ROUND('Table'[Value] , 0 ) / 24 , 
    ROUND('Table'[Value] / 24 * 48 , 0 ) / 48
)

10-08-_2020_17-27-03.png

Greetings FrankAT

View solution in original post

Highlighted
Helper I
Helper I

Re: "Direct Query" Switch to Time Format and Round to Nearest.

@FrankAT

sorry for the late reply,

Thanks for the update. this is the extact output i required.

regards

askspepsi

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Upcoming Events

Experience what’s next for Power BI

See the latest Power BI innovations, updates, and demos from the Microsoft Business Applications Launch Event.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

Mark your calendars and join us for our next Power BI Dev Camp!.

Top Solution Authors
Top Kudoed Authors