Skip to content

Instantly share code, notes, and snippets.

let fnCreateDimID =
(fact as table, col_name as text)=>
let
fnCreateDim = (fact as table, col_name as text)=>
let
removed_cols = Table.SelectColumns(fact,{col_name}),
dedupe = Table.Distinct(removed_cols),
sorted = Table.Sort(dedupe,{{col_name, Order.Ascending}}),
let fnCreateDimTables =
(t as table, optional exclusions as list) =>
let
// Get the schema for the table
Schema = Table.Schema(t),
// Select the text columns
AllTextCols = Table.SelectRows(Schema, each _[Kind] = "text")[Name],