This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sparkline Line = | |
// Static line color | |
VAR LineColor = "#01B8AA" | |
// "Date" field used in this example along the X axis | |
VAR XMinDate = MIN('Table'[Date]) | |
VAR XMaxDate = MAX('Table'[Date]) | |
// Obtain overall min and overall max measure values when evaluated for each date |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Author: Colin Banfield (https://social.technet.microsoft.com/profile/colin%20banfield/?ws=usercard-mini) | |
// Source: https://social.technet.microsoft.com/Forums/en-US/ee911661-6cb1-48ac-ae46-d70979b35cb7/homogeneous-list-types-in-m?forum=powerquery | |
// | |
(table as table, optional culture as nullable text) as table => | |
let | |
ValidTypes = {type any, type number, type date, type datetime, type datetimezone, | |
type time, type duration, type logical, type text, type binary, | |
Int64.Type, Percentage.Type, Currency.Type | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
( | |
SourceTable as table, // table to make replacements in | |
ToReplace as text, // name of the column for replacements | |
ReplacementTable as table // table with columns named "What" and "With" (with "what to replace" and "replace with" values respectively) | |
) as table => | |
let | |
JoinColumnName = Text.NewGuid(), | |
Correct = Table.NestedJoin(SourceTable, {ToReplace}, ReplacementTable, {"What"}, JoinColumnName, JoinKind.LeftAnti), | |
Part1 = Table.RemoveColumns(Correct, JoinColumnName), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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)), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ZIPFile) => | |
let | |
Header = BinaryFormat.Record([ Signature = BinaryFormat.ByteOrder(BinaryFormat.UnsignedInteger32,ByteOrder.LittleEndian), | |
Version = BinaryFormat.ByteOrder(BinaryFormat.UnsignedInteger16,ByteOrder.LittleEndian), | |
Flags = BinaryFormat.ByteOrder(BinaryFormat.UnsignedInteger16,ByteOrder.LittleEndian), | |
Compression = BinaryFormat.ByteOrder(BinaryFormat.UnsignedInteger16,ByteOrder.LittleEndian), | |
ModTime = BinaryFormat.ByteOrder(BinaryFormat.UnsignedInteger16,ByteOrder.LittleEndian), | |
ModDate = BinaryFormat.ByteOrder(BinaryFormat.UnsignedInteger16,ByteOrder.LittleEndian), | |
CRC32 = BinaryFormat.ByteOrder(BinaryFormat.UnsignedInteger32,ByteOrder.LittleEndian), | |
CompressedSize = BinaryFormat.ByteOrde |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(json) => | |
let | |
//List the expandable columns | |
expandableColumns = (_) => List.Accumulate( | |
Table.ColumnNames(_), | |
{}, | |
(s,c)=>s&(if Type.Is(Value.Type(Record.Field(_{0},c)), type record) | |
or Type.Is(Value.Type(Record.Field(_{0},c)), type list) | |
then {c} | |
else {}) |