Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi, All.
I am struggling to figure out how to get, in total hours, the difference between a start date column and the current/local time in Direct Query mode due to restrictions. I need the result to be in total decimal hours. Any thoughts or advice?
Thank you
Solved! Go to Solution.
Which source are you using? This measure worked with SQL Server.
TotalHrsFromNow =
SUMX ( DQDate, ( NOW () - DQDate[Date] ) / 24 )
Pat
You can use a measure.
calculate your local time using NOW() + yourTimezoneOffset / 24
and take a look at the DATEDIFF() function.
DATEDIFF was my first stop but it's not supported while using direct query. Neither is creating a DateTime.LocalNow using query editor. I will keep trying with a measure and see what I can come up with.
Which source are you using? This measure worked with SQL Server.
TotalHrsFromNow =
SUMX ( DQDate, ( NOW () - DQDate[Date] ) / 24 )
Pat
Oracle, and the measure is working now. I must have been missing something at first. Thank you!
User | Count |
---|---|
73 | |
70 | |
38 | |
24 | |
23 |
User | Count |
---|---|
96 | |
94 | |
50 | |
42 | |
40 |