Rounding datetimes to nearest minute or hour in Power Query
Sam Fischer Sam Fischer

Rounding datetimes to nearest minute or hour in Power Query

One of the most common culprits behind a large data model in Power BI is the presence of columns with a high cardinality. A common scenario where this occurs is when you’re dealing with event data, where you have precise datetimes down to the second for a series of events. For many applications, knowing the precise second that an event occurs isn’t as important as knowing what minute or hour it occurred in. In this post, I’ll introduce a Power Query function you can use to round a datetime field down to the nearest minute, 15 minutes or hour. This can reduce cardinality and lead to a more compact report file size.

Read More