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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

View discussion in a popup

Replying to:
tayloramy
Community Champion

Hi krishna_murthy 

 

-Best practice: convert UTC to IST as early as possible (ideally in SQL or Power Query) and then build your date columns from the IST value.
- For SQL Server: convert in the source using AT TIME ZONE.
- For Power Query (M): add a timezone, switch to IST, then remove the zone.
- DAX is OK for display, but it will not help DirectQuery and can lead to confusing group-bys; prefer SQL or Power Query for reliable totals.
Docs: AT TIME ZONE (T-SQL), DateTime.AddZone, DateTimeZone.SwitchZone, DateTimeZone functions, UTCNOW (DAX), DAX date/time functions.

 

1) Do it in SQL Server (recommended if you control the source)
Use AT TIME ZONE to translate UTC to IST and then derive your date keys from the IST column. IST has a fixed offset (+05:30) and no DST, so this is stable.

-- Example: convert UTC column to IST
SELECT
  t.EventUTC,
  -- Convert UTC -> IST
  (t.EventUTC AT TIME ZONE 'UTC') AT TIME ZONE 'India Standard Time' AS EventIST,
  -- Build date for grouping in IST
  CONVERT(date, ((t.EventUTC AT TIME ZONE 'UTC') AT TIME ZONE 'India Standard Time')) AS EventISTDate
FROM dbo.YourTable AS t;

Docs: AT TIME ZONE.

2) Do it in Power Query (M) in Power BI Desktop
If your column is plain datetime (no zone), first tag it as UTC, switch to IST, then remove the zone so the value is a normal datetime in IST. After that, create your date column from the IST value.

// Replace YourTable and UtcTime with your names
let
  Source = YourTable,
  // Treat existing datetime as UTC
  WithUtcZone = Table.TransformColumns(Source, {{"UtcTime", each DateTime.AddZone(_, 0), type datetimezone}}),
  // Switch to IST (UTC+5:30)
  ToIST = Table.TransformColumns(WithUtcZone, {{"UtcTime", each DateTimeZone.SwitchZone(_, 5, 30), type datetimezone}}),
  // Remove zone to get a plain datetime in IST
  IstDateTime = Table.TransformColumns(ToIST, {{"UtcTime", each DateTimeZone.RemoveZone(_), type datetime}}),
  // Optional: add a date column for grouping
  IstDate = Table.AddColumn(IstDateTime, "IstDate", each DateTime.Date([UtcTime]), type date)
in
  IstDate

 

Docs: DateTime.AddZone, DateTimeZone.SwitchZone, DateTimeZone functions.

3) DAX only (display or Import models; not ideal for grouping)
If you already imported data and must adjust in the model, create an IST column and then build your date from it. Note: this does not work in DirectQuery for calculated columns.

-- Add 5 hours 30 minutes to convert UTC to IST
IST DateTime = 'Table'[UtcTime] + TIME(5, 30, 0)

IST Date = DATE(
  YEAR('Table'[IST DateTime]),
  MONTH('Table'[IST DateTime]),
  DAY('Table'[IST DateTime])
)

 

Docs: DAX date/time functions, UTCNOW.

4) Notes and pitfalls
- Power BI Service uses UTC for NOW/TODAY variants; if you rely on those, be aware of the UTC behavior. See: UTCNOW and DAX date/time functions.
- For DirectQuery, prefer doing the conversion in SQL with AT TIME ZONE so grouping and filters reflect IST correctly.
- After converting, always derive your grouping columns (like Date) from the IST value, not the original UTC column.

 

If you found this helpful, consider giving some Kudos. If I answered your question or solved your problem, mark this post as the solution.