Skip to content

Instantly share code, notes, and snippets.

View hohlick's full-sized avatar

Maxim Zelensky hohlick

View GitHub Profile
section Section1;
Detect1000Languages = (input as list) as list =>
let
// TODO: support nulls, truncate text to avoid service limits
text = List.Buffer(input),
data = Table.FromColumns({text}, type table [text=text]),
indexed = Table.AddIndexColumn(data, "id", 1),
textId = Table.TransformColumnTypes(indexed, {{"id", type text}}),
body = [documents=Table.ReorderColumns(textId, {"id", "text"})],
Sparkline Line =
// Static line color - use %23 instead of # for Firefox compatibility
VAR LineColor = "%2301B8AA"
// "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
@DmitriyVlasov
DmitriyVlasov / ExampleDaxMeasureSVG.dax
Last active August 9, 2018 09:49
Example Create DAX Measure generate sparkline with SVG
Sparkline Line =
// Sample get from: https://powerbi.microsoft.com/en-us/blog/power-bi-desktop-august-2018-feature-summary/
// Formared width: http://www.daxformatter.com/
// Issue: SparlineMeasure var won't work when referenced (all bars end up 100%)
// Issue: Refactor to avoid nested SUMMARIZEs
// Issue: Negative values currently will not appear
VAR SparklineMeasure =
SUM ( Sales[SalesAmount] ) // don't use this below per issue above
VAR SparklineMeasureTarget =
@DmitriyVlasov
DmitriyVlasov / Power BI dax shortcut keys.md
Last active June 22, 2018 08:06
Power BI dax shortcut keys (Russian)

Памятка по сочетаниям клавиш окна редактирования DAX формул Microsoft Power BI

Базовое редактирование

Клавиша Описание
Ctrl+X Вырезать строку (Пустое выделение)
Ctrl+C Скопировать строку (Пустое выделение)
Alt+↑ Alt+↓ Перемещает текущую строку вверх / вниз
Shift+Alt+↑ Shift+Alt+↓ Копирует строку и вставляет её выше / ниже
@CurtHagenlocher
CurtHagenlocher / RowExpression.From.pq
Created March 6, 2018 23:26
RowExpression.From as JSON
let
Value.FixType = (value, optional depth) =>
let
nextDepth = if depth = null then 3 else depth - 1,
result = if depth = 0 then null
else if value is type then TextType(value)
else if value is table then Table.TransformColumns(value, {}, @Value.FixType)
else if value is list then List.Transform(value, each @Value.FixType(_, nextDepth))
else if value is record then
Record.FromList(List.Transform(Record.ToList(value), each @Value.FixType(_, nextDepth)), Record.FieldNames(value))
@r-k-b
r-k-b / power-query-iso-week-year.md
Last active February 8, 2024 21:44 — forked from robkb/power-query-iso-week-year.md
M functions to convert between ISO 8601 Week & Year ⇄ dates (e.g., `2014-12-29` ⇄ `"2015-W01-1"`)
@Hugoberry
Hugoberry / UnZIP.m
Created February 10, 2017 11:35
UnZip in Power Query M
(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
//list available DMVs
Select * from $SYSTEM.DBSCHEMA_TABLES where table_type = 'Schema' order by table_name
//Useful DMVs for 2016 SSAS Tabular Models
Select * from $SYSTEM.TMSCHEMA_ATTRIBUTE_HIERARCHY_STORAGES //distinct data count for each column
Select * from $SYSTEM.TMSCHEMA_ATTRIBUTE_HIERARCHIES //ties hierarchy id to column
SELECT * from $SYSTEM.TMSCHEMA_COLUMN_STORAGES //has order by column, row count is inaccurate
Select * from $SYSTEM.TMSCHEMA_COLUMNS //column name, ID for table, data type, category, hidden, iskey, isunique, is nullable, summarize by, expression for calc columns, hierarchy id, refresh time, modify time. source provider type, display folder
SELECT * from $SYSTEM.TMSCHEMA_DATA_SOURCES //connection string, account, impersonation mode, name
Select * from $SYSTEM.TMSCHEMA_HIERARCHIES //hierarchy name, display folder
@lukas-h
lukas-h / license-badges.md
Last active May 1, 2024 10:20
Markdown License Badges for your Project

Markdown License badges

Collection of License badges for your Project's README file.
This list includes the most common open source and open data licenses.
Easily copy and paste the code under the badges into your Markdown files.

Notes

  • The badges do not fully replace the license informations for your projects, they are only emblems for the README, that the user can see the License at first glance.

Translations: (No guarantee that the translations are up-to-date)