Skip to main content

Power BI

New

Optimize columns of the same table that have a one-to-one correspondence with each other

Vote (4) Share
Kenneth Barber's profile image

Kenneth Barber on 22 May 2023 17:36:56

If some columns of the same table have a one-to-one correspondence with each other (i.e. for each distinct value of any column, there is only 1 distinct value in the other columns), then they should be optimized to take advantage of that fact. Examples of optimizations:

  • All columns could share the same run-length encoding
  • Filters on one column would translate more directly to the cross-filtering of the other columns, which would address issues such as this


An example of an application of this type of optimization is between 2 columns where one specifies the sort order of the other. Another very useful and common application of this type of optimization is the Date table. This would obviously be useful for the Month and Month Number columns. However, we can take it a step further. Many of the common columns of Date tables can be represented as the date formatted using different custom format strings (e.g. Year: yyyy, Quarter: "Q"0, Month: mmmm, Month Number: m, Day: d), so, internally, these columns could be represented as a single column of dates with different formatting applied. This last example is not just one-to-one correspondence; it is equality.