Search code examples
powerbidaxpowerquerypowerpivot

DateTime or Integer for Model Run Date


I have some fact tables in my data model with millions of rows. Each table has its own refresh cycle. Now I have added the system date into every table within Power Query as a new column to show the last refresh. I am using this function:

DateTime.LocalNow() as datetime  

Since the tables contain millions of rows I am asking which data type is here the best? I could transform the DateTime to a decimal number and then changing with FORMAT in Power BI and a measure the decimal number back to DateTime, if necessary. How would you do that? Model Run Date as a decimal number or as DateTime? Is there any difference from a memory point of view?


Solution

  • Power BI uses columnar compression such that the memory size of a column is mostly dependent on the number of distinct values in that column. Because of that, any column with just a single value is going to be negligible in terms of memory and the data type isn't going to make any material difference.