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
#r "System.Net.Http" | |
#r "System.Windows.Forms" | |
using System; | |
using System.IO; | |
using System.Net.Http; | |
using System.Text; | |
using System.Linq; | |
using System.Collections.Generic; | |
using System.Windows.Forms; | |
using System.Drawing; |
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
using System; | |
using System.IO; | |
using System.Windows.Forms; | |
using System.Text.RegularExpressions; | |
using Newtonsoft.Json; | |
using Newtonsoft.Json.Linq; | |
// Custom form for collecting inputs | |
class InputForm : Form | |
{ |
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
# Sample visual - requires input dataframe 'df'. Expected to run in a Fabric notebook. | |
import matplotlib.pyplot as plt | |
import seaborn as sns # Use sns instead of sb for consistency with common practice | |
import numpy as np | |
import pandas as pd | |
import warnings | |
# Suppress the specific FutureWarning about use_inf_as_na | |
warnings.filterwarnings("ignore", category=FutureWarning, |
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
// Tabular Editor C# script for generating measure descriptions by using Claude 3.7 Sonnet | |
// Provided as-is; tested on TE3. The script itself was generated by using Claude 3.7 sonnet (i.e. not human-written). | |
// Requirements: Connected to a model, selecting a measure or column (or both) and added your Claude API key | |
// Note: Claude API keys require that you purchase credits; minimum of 5 USD | |
// Warning: Don't use on models with sensitive or confidential information. Validate all outputs before using them. | |
// Output: 1-3 bullet points descriptions for the fields you select and run the script on. |
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
using System.Net.Http; | |
using System.Net.Http.Headers; | |
using System.Text; | |
using Newtonsoft.Json; | |
using Newtonsoft.Json.Linq; | |
// URL of the powerqueryformatter.com API | |
string powerqueryformatterAPI = "https://m-formatter.azurewebsites.net/api/v2"; | |
// HttpClient method to initiate the API call POST method for the URL |
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
#r "System.Drawing" | |
// PLAY SNEK! | |
// By Kurt Buhler, Data Goblins; revisions by Daniel Otykier | |
// To use this script: | |
// 1. Open it in the Tabular Editor 3 Script Window. | |
// 2. Run it and have fun. | |
using System.Drawing; | |
using System.Drawing.Imaging; |
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
// Instructions | |
// ------------ | |
// 1. Save this script as a macro with a context of 'Column' and 'Measure' | |
// 2. Configure a keyboard shortcut for the macro (i.e. ALT + C) if using Tabular Editor 3 | |
// 3. Select any combination of columns & measures related in the model & run the script | |
// 4. The output will show you the evaluation result for all selected objects, presuming evaluation is valid | |
// Get column names | |
var _ColumnsList = new List<string>(); |
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
// Count calculation groups & calculation items | |
int _calcgroups = 0; | |
int _calcitems = 0; | |
foreach ( var _calcgroup in Model.CalculationGroups ) | |
{ | |
_calcgroups = _calcgroups + 1; | |
foreach ( var _item in _calcgroup.CalculationItems ) | |
{ | |
_calcitems = _calcitems + 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
using System.Net.Http; | |
using System.Net.Http.Headers; | |
using System.Text; | |
using Newtonsoft.Json; | |
using Newtonsoft.Json.Linq; | |
// URL of the powerqueryformatter.com API | |
string powerqueryformatterAPI = "https://m-formatter.azurewebsites.net/api/v2"; | |
// HttpClient method to initiate the API call POST method for the URL |
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
// This code is still WIP, it doesn't entirely filter the lineage. Feel free to make adjustments. | |
string dependancies = "::: mermaid\ngraph LR;\n%% Measure dependancy mermaid flowchart"; | |
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |
foreach(var _measures in Model.AllMeasures ) | |
{ | |
// Deep lineage for upstream measures |
NewerOlder