Skip to content

Instantly share code, notes, and snippets.

@hohlick
hohlick / Table.MassReplaceValues.pq
Created February 20, 2018 16:06
Power Query / Power BI / M function for mass values replacement in a table column (List version)
// fnMassReplace
(
Source as table, // table to make replacements in
ToReplace as text, // name of the column for replacements
ReplaceWhat as list, // list (or column reference) with "what to replace" values
ReplaceWith as list // list (or column reference) with "replace with" values
) as table =>
let
CurrentColumns = List.Buffer(Table.ColumnNames(Source)),
@idpaterson
idpaterson / Shop-Your-Way-Sweeps-Keyboard-Shortcuts.md
Last active August 9, 2018 05:56
Adds convenient keyboard shortcuts to Sears Shop Your Way Sweeps

Shop Your Way Sweeps Keyboard Shortcuts

@Mike-Honey
Mike-Honey / ExpandAllRecords.M
Created March 22, 2016 21:50
ExpandAllRecords function for Power Query or Power BI - expands all record-type columns recursively
// Based on Chris Webb's blog post - http://blog.crossjoin.co.uk/2014/05/21/expanding-all-columns-in-a-table-in-power-query/
let
//Define function taking two parameters - a table and an optional column number
Source = (TableToExpand as table, optional ColumnNumber as number) =>
let
//If the column number is missing, make it 0
ActualColumnNumber = if (ColumnNumber=null) then 0 else ColumnNumber,
//Find the column name relating to the column number
ColumnName = Table.ColumnNames(TableToExpand){ActualColumnNumber},
anonymous
anonymous / codereviews.cs
Created June 21, 2013 04:28
using Microsoft.TeamFoundation.Client;
using Microsoft.TeamFoundation.Framework.Client;
using Microsoft.TeamFoundation.Framework.Common;
using Microsoft.TeamFoundation.Framework.Server;
using Microsoft.TeamFoundation.WorkItemTracking.Client;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;