Forum Discussion
Time Zones
- 9 years ago
Actually I have litlle knowledge of DAX, and even less of Direct Query, but if your formula works, then I guess this will work as well:
CurrentTime = "Time : " & IF(HOUR(NOW()) < 1,12,if(HOUR(NOW())>12,HOUR(NOW())-12,HOUR(NOW()))) & ":" & MINUTE(NOW()) & ":" & SECOND(NOW()) & IF(HOUR(NOW())<12," AM"," PM")
Either =NOW() and format as hh:mm:ss tt
or = FORMAT(NOW(), "hh:mm:ss AM/PM")
By the way: this is more about time format than time zones, as the subject suggests.
Hi MarcelBeug,
Thanks for the reply. I used direct query for this, i guess FORMAT() will not work for direct query.
Is their any other way to achieve that?
- MarcelBeug9 years agoCommunity Champion
Actually I have litlle knowledge of DAX, and even less of Direct Query, but if your formula works, then I guess this will work as well:
CurrentTime = "Time : " & IF(HOUR(NOW()) < 1,12,if(HOUR(NOW())>12,HOUR(NOW())-12,HOUR(NOW()))) & ":" & MINUTE(NOW()) & ":" & SECOND(NOW()) & IF(HOUR(NOW())<12," AM"," PM")
- Manivannan9 years agoHelper I
Hi Marcel,
Thanks for the help. It worked for me.
- v-chuncz-msft9 years agoCommunity Support
Since your problem has been resolved, please help accept solution. Your contribution is highly appreciated.
- v-chuncz-msft9 years agoCommunity Support
By the way, to ensure that queries sent to the underlying data source have acceptable performance, limitations are imposed on measures by default. Advanced users can choose to bypass this limitation by selecting File > Options and settings > Options > DirectQuery, then selecting the option "Allow unrestricted measures in DirectQuery mode".