Floor(OrderTimestamp) AS OrderDate

Splitting timestamps into date and time in Power BI

Qlik developers split timestamps with Floor() for the date and Frac() for the time, partly to save memory. Do the same in Power Query with DateTime.Date and DateTime.Time. It makes the date join to the calendar table and reduces column cardinality in VertiPaq, so the reason is the same in both tools.

Direct equivalent Power Query

Short answer: In Power Query, add a Date column (DateTime.Date([Timestamp])) and a Time column (DateTime.Time). Round the time to the minute if seconds don't matter, then remove the original timestamp.

What it does in Qlik

  • Floor(ts) drops the time part, keeping the number of days.
  • Frac(ts) keeps only the time fraction.
  • Date(...), Time(...) and Timestamp(...) only format the value. They don't remove the time part, which is a common mistake.

Qlik example

Qlik script
Date(Floor(OrderTS))              AS OrderDate,
Time(Round(Frac(OrderTS), 1/1440)) AS OrderTime   // nearest minute

Power BI equivalent

Power Query

Power Query M
= Table.AddColumn(Src, "OrderDate", each DateTime.Date([OrderTS]), type date)
= Table.AddColumn(Src, "OrderTime", each
    let t = DateTime.Time([OrderTS]) in #time(Time.Hour(t), Time.Minute(t), 0), type time)
// then remove OrderTS if you don't need it

DAX (only if you can't change the query)

DAX
Order Date = DATE ( YEAR ( T[OrderTS] ), MONTH ( T[OrderTS] ), DAY ( T[OrderTS] ) )

Gotchas and behaviour differences

  • Changing a column's data type to Date in Power Query truncates the time, like Floor. Changing only the format in the model, to a short date, still stores the full timestamp, and the relationship to the calendar won't match. That's the Power BI version of Qlik's Date()-without-Floor() bug.
  • A datetime column with seconds can have millions of distinct values. Splitting it shrinks the model in Power BI for the same reason it does in Qlik.

Official documentation

Related pages

Spotted an error or a better pattern? QlikToDax is maintained by a working BI consultant; corrections are welcome via the About page. Last reviewed 2026-10-25.