This file contains hidden or 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
let | |
Switch = Function.From( | |
type function (value as any, l as list, default as any) as any, | |
(params) => | |
let | |
// Function to select nth item of list | |
// If you pass in zero, you get even indices | |
// If you pass in one, you get odd indices | |
fnSelectEvenOdd = (lst as list, remainder as number) as list => | |
let |
This file contains hidden or 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
REM Uses pbi-tools to extract the data model info and create the BIM file associated with each PBIX file in the directory | |
REM Batch file code written by Brian Julius, October 8, 2024 | |
REM @echo off | |
SETLOCAL ENABLEDELAYEDEXPANSION | |
REM ============================================================ | |
REM Batch Script to Extract BIM Files from PBIX Files | |
REM All PBIX files are in C:\test | |
REM All BIM files will be written to C:\test\bim_files | |
REM ============================================================ |
This file contains hidden or 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
//Created by Brian Julius, 23 Oct 2024 using AI model o1-P | |
BulletChartSVG = | |
VAR __TotalSales = [Total Sales] | |
VAR __TargetSales = [Current Year Sales Target] | |
-- Normalize the bars by using the maximum target sales across all data | |
VAR __MaxTargetSales = [Max Sales Target] | |
-- Scale the bars based on the maximum target sales |
This file contains hidden or 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
/** DistinctListSort */ | |
/* | |
FUNCTION NAME: DistinctListSort | |
DESCRIPTION: Given a n-row by 1-column range of concatenated text, | |
returns a n-row by 1-column array of the unique values. Return | |
array is sorted | |
ARGS: | |
rng: Range holding original values | |
delim: Delimiter used to split the concatenated strings | |
col: Column index you want returned (1st column = 1) |
This file contains hidden or 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
/** DistinctList */ | |
/* | |
FUNCTION NAME: DistinctList | |
DESCRIPTION: Given a n-row by 1-column range of concatenated text, | |
returns a n-row by 1-column array of the unique values. Not | |
sorted (use DistinctListSort to get sorted list) | |
ARGS: | |
rng: Range holding original values | |
delim: Delimiter used to split the concatenated strings | |
col: Column index you want returned (1st column = 1) |
This file contains hidden or 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
/** ConcatRowsFormat */ | |
/* | |
FUNCTION NAME: ConcatRowsFormat | |
DESCRIPTION: For a rectangular array (including table refs), returns | |
a dynamic array 1 column wide and n rows tall, concatenating the | |
values from each row and applying the specified number formats | |
to the values from each column | |
ARGS: | |
rng: The source range to be concatenated | |
format: 1-row by n-column array of number formats to apply |
This file contains hidden or 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
/** ConcatRows */ | |
/* | |
FUNCTION NAME: ConcatRows | |
DESCRIPTION: For a rectangular array (including table refs), returns | |
a dynamic array 1 column wide and n rows tall, concatenating the | |
values from each row | |
ARGS: | |
rng: The source range to be concatenated | |
delim: The delimiter to be used | |
skipblanks: In each row's concatenation, TRUE skips blank |
This file contains hidden or 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
/** GetDistanceMiles */ | |
/* | |
FUNCTION NAME: GetDistanceMiles | |
DESCRIPTION: Returns the distance in miles between points X and Y based on their | |
decimal latitude and longitude coordinates | |
ARGS: | |
LatX: Point X's decimal latitude | |
LngX: Point X's decimal longitude | |
LatY: Point Y's decimal latitude | |
LngY: Point Y's decimal longitude |
This file contains hidden or 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
let | |
fnGetSQLServer = | |
let | |
GetSQLServerType = type function ( | |
server as ( | |
type text | |
meta [ | |
Documentation.FieldCaption = "Server Name", | |
Documentation.FieldDescription = "SQL Server name", | |
Document.SampleValues = {"SERVER"}, |
This file contains hidden or 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
# "#################################################" | |
# Dockerfile to build a GitHub Pages Jekyll site | |
# - Ubuntu 22.04 | |
# - Ruby 3.1.2 | |
# - Jekyll 3.9.3 | |
# - GitHub Pages 288 | |
# | |
# This code is from the following Gist: | |
# https://gist.github.com/BillRaymond/db761d6b53dc4a237b095819d33c7332#file-post-run-txt | |
# |