cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
YoussefN
Regular Visitor

Calculation in hours between date and time

Hi,

 

I have a table with logging moments for service calls. I use two measures to find the first start date

Date Time Created = CALCULATE(MIN(PBI_SER_Doc_ref_point[Date_Time_Registrated]);FILTER(PBI_SER_Doc_ref_point; PBI_SER_Doc_ref_point[Reference_Point]="8"))

and the date when the call is closed

 

Date Time Function Recovered = CALCULATE(MAX(PBI_SER_Doc_ref_point[Date_Time_Registrated]);FILTER(PBI_SER_Doc_ref_point; PBI_SER_Doc_ref_point[Reference_Point]="10"))

Now I want the caluclate the difference between those measures. But when I use a measure to calculate the difference I get an date as awnser. I want the total difference in hours. I also added an example of my table which I extract.

 

 

Call dateCall date

1 ACCEPTED SOLUTION
Zubair_Muhammad
Community Champion
Community Champion

Hi @YoussefN

 

Try the DateDiff function in DAX

 

https://msdn.microsoft.com/en-us/library/dn802538.aspx?f=255&MSPPError=-2147217396

 

Try this MEASURE

 

MEASURE =
DATEDIFF ( [Date Time Created], [Date Time Function Recovered], HOUR )

Regards
Zubair

Please try my custom visuals

View solution in original post

2 REPLIES 2
Zubair_Muhammad
Community Champion
Community Champion

Hi @YoussefN

 

Try the DateDiff function in DAX

 

https://msdn.microsoft.com/en-us/library/dn802538.aspx?f=255&MSPPError=-2147217396

 

Try this MEASURE

 

MEASURE =
DATEDIFF ( [Date Time Created], [Date Time Function Recovered], HOUR )

Regards
Zubair

Please try my custom visuals

wow @Zubair_Muhammad

 

Thanx for your quick response it worked!

 

Youssef

Helpful resources

Announcements
August 2022 update 768x460.jpg

Check it Out!

Click here to learn more about the August 2022 updates!

August 1 episode 9_no_dates 768x460.jpg

The Power BI Community Show

Watch the playback when Priya Sathy and Charles Webb discuss Datamarts! Kelly also shares Power BI Community updates.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Top Solution Authors
Top Kudoed Authors