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

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.

Reply
Manivannan
Helper I
Helper I

Time Zones

Hi,

 

I have created a measure to display "Time", i need AM/PM also to be displayed along with it.

How to achieve that?

 

Cap.PNG

 

Capture.PNG

 

Regards,

Manivannan M

 

1 ACCEPTED 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")
Specializing in Power Query Formula Language (M)

View solution in original post

8 REPLIES 8
Interkoubess
Solution Sage
Solution Sage

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

Time_PP.PNG

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.

Specializing in Power Query Formula Language (M)

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?

 

 

 

 

@Manivannan,

 

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".

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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")
Specializing in Power Query Formula Language (M)

Hi Marcel,

 

Thanks for the help. It worked for me.

@Manivannan,

 

Since your problem has been resolved, please help accept solution. Your contribution is highly appreciated.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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