Skip to content

Instantly share code, notes, and snippets.

View PBI-DataVizzle's full-sized avatar
💭
Shizzle my Vizzle 🤓

Imran Haq PBI-DataVizzle

💭
Shizzle my Vizzle 🤓
View GitHub Profile
let
fnGetSQLServer =
let
GetSQLServerType = type function (
server as (
type text
meta [
Documentation.FieldCaption = "Server Name",
Documentation.FieldDescription = "SQL Server name",
Document.SampleValues = {"SERVER"},
{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"data": {
"values": [
{
"party": "LAB",
"seats": 412,
"change": 211,
"share": 0.63,
"img_url": "https://i.ibb.co/93h9jqD/labour.png"
<svg viewBox='0 0 630 100' xmlns='http://www.w3.org/2000/svg'>
<defs>
<style>
.cls-1{fill: "&var_emptyBarColor&";}
.cls-2{fill: "&var_filledBarColor&";}
.percentage-text { font-size: 20px; font-weight: bold; fill: black; }
</style>
</defs>
<!-- Background Empty Bar -->
<svg xmlns='https://www.w3.org/500/svg' width='100%' height='100%' viewBox='0 0 40 40'>
<defs>
<linearGradient id='gradient' x1='100%' y1='0%' x2='5%' y2='5%' spreadMethod='pad'>
<stop offset='0%' stop-color='#17D500'/>
<stop offset='100%' stop-color='#D50000'/>
</linearGradient>
</defs>
@PBI-DataVizzle
PBI-DataVizzle / vega_radial_unit_chart.json
Created December 15, 2024 07:41
vega_radial_unit_chart
{
"$schema": "https://vega.github.io/schema/vega/v5.json",
"width": 500,
"height": 500,
"padding": 50,
"background": "#222431",
"signals": [
{
"name": "textGradient",
"update": "{gradient: 'linear', stops: [{offset: 0, color: '#14d8cc'}, {offset: 1, color: '#4c8bee'}]}"
/** 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
@PBI-DataVizzle
PBI-DataVizzle / ConcatRows.txt
Created November 29, 2024 19:43 — forked from matthews-p/ConcatRows.txt
ConcatRows
/** 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
/** 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
/** 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)
/** 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)