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 fnCreateDimID = | |
| (fact as table, col_name as text)=> | |
| let | |
| fnCreateDim = (fact as table, col_name as text)=> | |
| let | |
| removed_cols = Table.SelectColumns(fact,{col_name}), | |
| dedupe = Table.Distinct(removed_cols), | |
| sorted = Table.Sort(dedupe,{{col_name, Order.Ascending}}), |
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 fnCreateDimTables = | |
| (t as table, optional exclusions as list) => | |
| let | |
| // Get the schema for the table | |
| Schema = Table.Schema(t), | |
| // Select the text columns | |
| AllTextCols = Table.SelectRows(Schema, each _[Kind] = "text")[Name], |
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 | |
| fnRoundDateTime = (dt as datetime, interval as number) => | |
| let | |
| Source = Number.From(dt), | |
| Minutes = 24 * 60 / interval, | |
| Rounded = Number.RoundAwayFromZero((Source * Minutes), 0) / Minutes, | |
| DateTime = DateTime.From(Rounded) | |
| in | |
| DateTime, | |
| fnType = type function (dt as datetime, interval as number) as datetime |
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
| <svg xmlns="http://www.w3.org/2000/svg" width="400" height="400" viewBox="0 0 400 400" fill="none"> | |
| <def> | |
| <rect id="bgRect" width="150" height="150"/> | |
| <rect id="fgRect" width="125" height="110" fill="white"/> | |
| <rect id="noChange" width="20" height="5" fill="gray"/> | |
| </def> | |
| <g id="doGroup"> | |
| <use href="#bgRect" x="42" y="38" fill="#A5D0A8"/> | |
| <use href="#fgRect" x="56" y="67"/> | |
| <text id="header" x="100" y="60" fill="white" font-weight="bold" font-size="20">DO</text> |
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
| 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 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
| 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 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
| /* | |
| Function: fnHoltWinters | |
| Description: Trying to replicate HoltWinters quantitative smoothing with Power Query. | |
| Author: Chris Aragao | |
| Change Log: | |
| 11.13.2023 - Initial release. Initial code was based off of this tutorial: https://www.exceldemy.com/holt-winters-exponential-smoothing-in-excel/. | |
| It was aimed at solely duplicating the output and did so. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 | |
| fnErlangC = | |
| ( | |
| number_of_calls as number, | |
| period_of_minutes as number, | |
| average_handling_time as number, | |
| required_service_level as number, | |
| target_answer_time as number, | |
| maximum_occupancy as number, |
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
| // white wine dataset used from http://archive.ics.uci.edu/dataset/186/wine+quality | |
| { | |
| "data": { | |
| "name": "dataset" | |
| }, | |
| "params": [ | |
| { | |
| "name": "grid", | |
| "select": "interval", |