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 fnFactor = | |
| (num as number) => | |
| let | |
| fnFactors = (x as number) => | |
| List.Generate( | |
| () => [f1 = 1, f2 = x, non_integer = true], | |
| each [f1] <= num, | |
| each [ | |
| f1 = [f1] + 1, | |
| f2 = x / ([f1] + 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
| (t as table) => | |
| let | |
| correlation = (x as list, y as list) => | |
| let | |
| x1 = List.Transform(x, each Number.From(_)), | |
| y1 = List.Transform(y, each Number.From(_)), | |
| sum_x = List.Sum(x1), | |
| sum_y = List.Sum(y1), | |
| sum_x_sq = List.Accumulate( | |
| x1, |
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 | |
| Source = Excel.CurrentWorkbook(){[Name = "Table1"]}[Content], | |
| base = Table.TransformColumnTypes( | |
| Source, | |
| { | |
| {"Name", type text}, | |
| {"Date", type date}, | |
| {"Amount", Int64.Type}, | |
| {"Date2", type date}, | |
| {"Amount3", Int64.Type}, |
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
| // First create the header of the SVG | |
| Set( | |
| varHeartHeader, | |
| "<svg xmlns='http://www.w3.org/2000/svg' width='250' height='250' viewBox='0 0 250 250' fill='none'> | |
| <rect width='250' height='250' fill='#F5F5F5'/> | |
| <rect x='2.5' y='2.5' width='245' height='245' fill='white'/> | |
| <rect x='2.5' y='2.5' width='245' height='245' stroke='#121C41' stroke-width='5'/>" | |
| ); | |
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 | |
| fnMegaStDevSample = | |
| (l as list)=> | |
| let | |
| // function for trimmed average | |
| fnGetTrimmed = | |
| (lst as list)=> | |
| let |
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
| DimDate = | |
| VAR MinDate = DATE(2011,1,1) | |
| VAR MaxDate = DATE(2030,12,31) | |
| VAR PayPeriodStarts = | |
| FILTER ( | |
| GENERATESERIES ( DATE ( 2010, 12, 19 ), DATE ( 2031, 1, 5 ), 14 ), | |
| [Value] >= MinDate | |
| && [Value] <= MaxDate | |
| ) | |
| VAR PayPeriodEnds = |
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 | |
| fnMegaAverage = | |
| (l as list)=> | |
| let | |
| // function for trimmed average | |
| fnGetTrimmed = | |
| (lst as list)=> | |
| let |
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
| (z as number, stdev as number, population as number, optional mode as text)=> | |
| let | |
| // check optional parameter and default to s for sample | |
| m = if mode = null then "s" else mode, | |
| // subtract 1 from population for samples and make that default | |
| n = if m = "p" then population else population -1, |