The SQL view for the product dimension referenced earlier in this chapter contained the following four operations:
- Join the Product, ProductSubcategory, and ProductCategory dimension tables into a single query
- Create a custom product category group column (for example, Bikes versus Non-Bikes)
- Apply report-friendly column names with spaces and proper casing
- Replace any null values in the Product Subcategory and Product Category columns with the 'Undefined' value
Like almost all operations available to SQL SELECT queries, the same query can also be created via M functions. If the SQL view for the product dimension cannot be created within the data source, the following M query produces the same results:
let