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
# Install the MicrosoftPowerBIMgmt module required for managing Power BI resources. | |
# This module is installed for the current user only, to avoid system-wide changes. | |
Install-Module -Name MicrosoftPowerBIMgmt -Scope CurrentUser | |
# Authenticate to the Power BI Service. | |
# This step is necessary to access and manage Power BI resources. | |
Login-PowerBIServiceAccount | |
# Function to retrieve all Power BI workspaces. | |
# It fetches data from the Power BI API and handles pagination to get all workspaces. |
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
target card = | |
// unsat, below, near, hit | |
VAR _Q1_result = "unsat" | |
VAR _Q2_result = "below" | |
VAR _Q3_result = "near" | |
VAR _Q4_result = "hit" |
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 = | |
// dummy value in a table | |
VAR _vals = { | |
( 0, 500 ), | |
( 1, 700 ), | |
( 2, 1200 ), | |
( 3, 1250 ), | |
( 4, 550 ), | |
( 5, 780 ), | |
( 6, 990 ), |
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
{ | |
"$schema": "https://vega.github.io/schema/vega-lite/v5.json", | |
"transform": [ | |
{"filter": "indexof(selectedDepartments, datum['Department']) >=0"}, | |
{"fold": ["Budgeted $", "Paid $"]}, | |
{ | |
"joinaggregate": [ | |
{"op": "min", "field": "value", "as": "min"}, | |
{"op": "max", "field": "value", "as": "max"} | |
], |
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
// white wine dataset used from http://archive.ics.uci.edu/dataset/186/wine+quality | |
{ | |
"data": { | |
"name": "dataset" | |
}, | |
"params": [ | |
{ | |
"name": "grid", | |
"select": "interval", |
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
5x5 Waffle = | |
VAR _max = 500 | |
VAR _actual = 120 | |
VAR _waffles = ROUND((_actual/_max) * 50, 0) | |
VAR _gray = "#7A7979" | |
VAR _red = "#FF0000" | |
VAR _header = "data:image/svg+xml;utf8,<svg width=""200"" height=""200"" viewBox=""0 0 200 200"" fill=""none"" xmlns=""http://www.w3.org/2000/svg""> | |
<rect width=""200"" height=""200"" fill=""white""/>" | |
VAR _footer = "</svg>" |
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
Pie Card = | |
// set the actual value | |
VAR _actual = 120 | |
// set the target | |
VAR _max = 150 | |
// determine the pct | |
VAR _pct = _actual/_max |
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
bullet = | |
// set a percentage for underachieving score | |
VAR _bad = .5 // set a percentage for sat score | |
VAR _sat = .75 // target will be 100% | |
VAR _target = 1 // max width set at 500 in case actual is over 100% | |
VAR _max_width = 500 // set actual percentage | |
VAR _actual = 1.2 // figure out ratio for underperforming area | |
VAR b_ratio = _bad * _max_width // figure out ratio for sat area | |
VAR s_ratio = _sat * _max_width // figure out ratio for target line | |
VAR t_ratio = _target * _max_width // figure out ratio for actual and ensure it is not larger than default width of svg |
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
ONS = | |
{ | |
("W07000081", "Aberafan Maesteg" ), | |
("W07000082", "Alyn And Deeside" ), | |
("W07000083", "Bangor Aberconwy" ), | |
("W07000084", "Blaenau Gwent And Rhymney" ), | |
("W07000085", "Brecon, Radnor And Cwm Tawe" ), | |
("W07000086", "Bridgend" ), | |
("W07000087", "Caerfyrddin" ), | |
("W07000088", "Caerphilly" ), |
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
{ | |
"data": {"name": "dataset"}, | |
"transform": [ | |
{ | |
"calculate": "datum['Index'] <= datum['_percToShow'] * 100 ? 1 : 0", | |
"as": "_color" | |
} | |
], | |
"layer": [ | |
{ |
NewerOlder