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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
askspepsi
Helper II
Helper II

{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
FrankAT
Community Champion
Community Champion

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
FrankAT
Community Champion
Community Champion

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

@FrankAT

sorry for the late reply,

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

regards

askspepsi

amitchandak
Super User
Super User

@amitchandak 

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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