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
MKM
Helper I
Helper I

How to find hours in date

Hi Team,

 

without using create new column bez i have connected direct query ...........based on measure how we can separate hours, minuts , seconds from date.

 

so the result i needed 1,2,3, .... 24(hours) based on date and time.

17-05-2023 15:17
3 REPLIES 3
tamerj1
Super User
Super User

Hi @MKM 
Please try

Hour =
HOUR ( SELECTEDVALUE ( 'Table'[DateTime] ) )

yes its working .... Same measure im trying to keep in matrix table under column field but not taking it.... is that way power Bi design.

 

So Finaly wat i want  hourly wise sales. but see the below its taking that measure under values field.

not require below kind of farmet.

 

MKM_0-1684322272976.png

 

@MKM 
What you're looking for requires creating a column in the data table. I think calculated columns that involve time are permitting when using direct query so this has to be done in power query. You can use the Time.Hour function.

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.