Skip to content

Instantly share code, notes, and snippets.

Dmitriy Vlasov DmitriyVlasov

View GitHub Profile
View mssql-calendar-table.sql
USE [master]
IF OBJECT_ID('dbo.calendar') IS NOT NULL
DROP TABLE [dbo].[calendar];
IF OBJECT_ID('dbo.fn_generate_calendar') IS NOT NULL
DROP FUNCTION [dbo].[fn_generate_calendar];
DmitriyVlasov / MangoOfficeVpbx.m
Created Jul 11, 2019
Example Power BI Custom Connector for Mango Office VPBX
View MangoOfficeVpbx.m
// This file contains your Data Connector logic
section MangoOfficeVpbx;
[DataSource.Kind="MangoOfficeVpbx", Publish="MangoOfficeVpbx.UI"]
shared MangoOfficeVpbx.Contents = (optional dateTimeFrom as datetime, optional dateTimeTo as datetime, optional fields_list as list) =>
get_full_data( dateTimeFrom, dateTimeTo, fields_list );
// Mango Office Vpbx Configuration settings
DmitriyVlasov /
Created Jun 23, 2019 — forked from protrolium/
using ffmpeg to extract audio from video files


Converting Audio into Different Formats / Sample Rates

Minimal example: transcode from MP3 to WMA:
ffmpeg -i input.mp3 output.wma

You can get the list of supported formats with:
ffmpeg -formats

Convert WAV to MP3, mix down to mono (use 1 audio channel), set bit rate to 64 kbps and sample rate to 22050 Hz:

View Added-date-and-hour-colum.dax
// На большом объеме данных так работает плохо!!!
var date_time_text = format( 'fact_data'[moment]; "dd.MM.yyyy hh:00:00" )
var current_date = DATEVALUE( date_time_text )
var current_time = timeVALUE( date_time_text )
var curent_datetime = current_date + current_time
return curent_datetime
DmitriyVlasov / Added-date-and-hour-colum.m
Last active May 22, 2019
Added Date and Hour Colum
View Added-date-and-hour-colum.m
Source =
[ moment = DateTime.LocalNow() ]
AddYearColumn = Table.AddColumn( Source, "year", each Date.Year( [moment] ), Int32.Type ),
AddMontholumn = Table.AddColumn( AddYearColumn, "month", each Date.Month( [moment] ), Int32.Type ),
AddDayColumn = Table.AddColumn( AddMontholumn, "day", each Date.Day( [moment] ), Int32.Type ),
DmitriyVlasov / fable-repl.css
Last active Mar 29, 2019
Minimal application showing how to use Elmish
View fable-repl.css
body {
font-size: 16px;
.main-container {
display: flex;
width: 100%;
height: 100%;
justify-content: center;
View getProductionCalendar.m
// Пример использования функции получения Производственного календаря:
// источник взят отсюда:
// На момент 24.05.2018 в календаре содержатся описание праздников с 1999 года по 2025 год.
// let
// "",
// ProductionCalendar = getProductionCalendar( PROD_СALENDAR_URL )
// in
View Power BI Sparkline Line.DAX
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 / ExampleDaxMeasureSVG.dax
Last active Aug 9, 2018
Example Create DAX Measure generate sparkline with SVG
View ExampleDaxMeasureSVG.dax
Sparkline Line =
// Sample get from:
// Formared width:
// 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 / Power BI dax shortcut
Last active Jun 22, 2018
Power BI dax shortcut keys (Russian)
View Power BI dax shortcut

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

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

Клавиша Описание
Ctrl+X Вырезать строку (Пустое выделение)
Ctrl+C Скопировать строку (Пустое выделение)
Alt+↑ Alt+↓ Перемещает текущую строку вверх / вниз
Shift+Alt+↑ Shift+Alt+↓ Копирует строку и вставляет её выше / ниже
You can’t perform that action at this time.