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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.

Top Solution Authors