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
{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"usermeta": {
"deneb": {
"build": "1.4.0.0",
"metaVersion": 1,
"provider": "vegaLite",
"providerVersion": "5.4.0"
},
"interactivity": {
@PBI-DataVizzle
PBI-DataVizzle / AutoPopulateMeasureDescriptionsFromOpenAIWithDelay.csx
Created April 6, 2024 03:46 — forked from dgosbell/AutoPopulateMeasureDescriptionsFromOpenAIWithDelay.csx
Update Tabular Model Descriptions from ChatGPT with rate limiting logic
#r "System.Net.Http"
using System.Net.Http;
using System.Text;
using Newtonsoft.Json.Linq;
// You need to signin to https://platform.openai.com/ and create an API key for your profile then paste that key
// into the apiKey constant below
const string apiKey = "<YOUR API KEY HERE>";
const string uri = "https://api.openai.com/v1/completions";
const string question = "Explain the following calculation in a few sentences in simple business terms without using DAX function names:\n\n";
// =====================================
// Author: Darren Gosbell
// Date: 12 Apr 2023
// This script works in Tabular Editor and sets the MaxParallelismPerQuery
// setting at the database level.
// =====================================
if (Model.Database.CompatibilityLevel < 1569)
{
Model.Database.CompatibilityLevel = 1569;
@PBI-DataVizzle
PBI-DataVizzle / bump_chart_template
Created April 6, 2024 03:36
BumpChart template
{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"usermeta": {
"deneb": {
"build": "1.4.0.0",
"metaVersion": 1,
"provider": "vegaLite",
"providerVersion": "5.4.0"
},
"interactivity": {
{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"width": 500,
"data": {
"values": [
{
"phase": "0",
"name": "Project 1",
"start": "2023-03-01",
"end": "2023-03-15",
{
"$schema": "https://vega.github.io/schema/vega/v5.json",
"description": "IBCS based three-tier chart to show: 1) absolute values, 2) absolute variances, 3) relative variances.",
"usermeta": {
"Copyright": "Andrzej Leszkiewicz",
"License": "MIT Expat License (https://en.wikipedia.org/wiki/MIT_License)",
"Permission": "Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.",
"Github": "https://github.com/avatorl/Deneb-Vega/",
"Design Style": "IBCS Multi-tier bar charts",
"Design Style
Table.AddColumn(GetDates, "Last Working Date", each
Date.AddDays(Date.EndOfMonth([Date]),
List.Min({0, 4 - Date.DayOfWeek(Date.EndOfMonth([Date]),
Day.Monday)})))
List.Select(
List.Dates([EndOfMonth], Duration.From(- 1)),
each Date.DayOfWeek(_, Day.Monday) < 5
)
// This gist containt useful pieces of DAX code
@PBI-DataVizzle
PBI-DataVizzle / 00 Tabular editor scripts
Created March 7, 2024 12:49 — forked from OscarValerock/00 Tabular editor scripts
Tabular editor scripts for Power BI
//This gist contains useful tabular editor scripts.