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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Sunil0741
Regular Visitor

How to Convert date and time from PST to IST

I have a question in Power BI.

 

I am using an ODBC data source lnked directly to power BI, which has a column of date and time recorded in PST timezone.

Now I am looking to add a column in Power BI which shall have date and time converted from above said PST timezone to IST timezone.

 

For an example:

Column A has 07/05/2022 07:30:00 AM PST

I need In column B as 07/05/2022 08:00:00 PM IST

7 REPLIES 7
Jameswalter
New Member

On the left, select the 'Power BI Analytics' tab.
On this page, select the 'Settings' tab at the top right.
On the page that appears, you'll see your current time zone listed. 
A drop-down will appear where you can select a new time zone.
Click 'Save'.

 

Regards,
J Wick

I am using power bi desktop and I don't see On the left, select the 'Power BI Analytics' tab

 

Thanks for your help.

v-chenwuz-msft
Community Support
Community Support

Hi @Sunil0741,

 

No, for DirectQuery mode, considering the performance, complex calculations cannot be used. This is a limitation of directquery.

You can try Import mode for ODBC.

 

Or, you can try the something like the following screenshot.

vchenwuzmsft_0-1659425948478.png

 

 

IST = SELECTEDVALUE(datetime_table[datetime]) + TIME(12,30,0)
 

Best Regards

Community Support Team _ chenwu zhu

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-chenwuz-msft 

 

Thank you. I tried adding 12 hours 30 minutes but it vary during daylight saving as 13 hours 30 minutes.

 

That is where I am looking to convert date and time considering daylight saving.

 

Sunil0741_0-1659427092939.png

Hi @Sunil0741 ,

 

Or try use IF statement to identify date?

Like this:

ist =
VAR _selecteddate =
    SELECTEDVALUE ( datetime_table[datetime] )
VAR _selecteddateYear =
    YEAR ( _selecteddate )
VAR _start =
    DATE ( _selecteddateYear, 3, 1 ) + 7
        - WEEKDAY ( DATE ( _selecteddateYear, 3, 1 ), 2 ) + 7
VAR _end =
    DATE ( _selecteddateYear, 11, 1 ) + 7
        - WEEKDAY ( DATE ( _selecteddateYear, 11, 1 ), 2 )
RETURN
    IF (
        _selecteddate >= _start
            && _selecteddate <= _end,
        _selecteddate + TIME ( 13, 30, 0 ),
        _selecteddate + TIME ( 12, 30, 0 )
    )

Result:

 

vchenwuzmsft_0-1659607430656.png

 

Best Regards

Community Support Team _ chenwu zhu

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

Hi @v-chenwuz-msft 

Am I missing something ? I see same dates using the above solution.

 

Sunil0741_0-1659768330814.png

 

amitchandak
Super User
Super User

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.