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.
Hi,
I have created a measure to display "Time", i need AM/PM also to be displayed along with it.
How to achieve that?
Regards,
Manivannan M
Solved! Go to Solution.
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")
Hi @Manivannan,
How your data are stored?
In power query you can use this feature as below.
I hope it helps otherwise let us know with more examples..
Thx
Hi Interkoubess,
Thanks for the reply.
I used direct query.
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?
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".
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")
Hi Marcel,
Thanks for the help. It worked for me.
Since your problem has been resolved, please help accept solution. Your contribution is highly appreciated.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
94 | |
82 | |
66 | |
58 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |