greggyb · @greggyb
32 followers · 61 posts · Server mastodon.sdf.org

Another great article from Ben Gribaudo on and , this time exploring the nuance of the global environment in a custom connector. If you want to understand M better, his series is essential reading.

bengribaudo.com/blog/2022/12/2

#PowerQuery #Mlang #powerbi

Last updated 3 years ago

greggyb · @greggyb
22 followers · 31 posts · Server mastodon.sdf.org

Day 11 of in

Today is the first day where the crux is an insight not in the problem statement. In this case modulo arithmetic keeps us from overflowing bigints and doubles.

Also, a good exercise in comparing two different factorings of a problem, because my first approach did not scale.

Follow code and progress: antifound.com/posts/advent-of-

adventofcode.com/2022/day/11

#adventofcode #powerbi #PowerQuery #Mlang

Last updated 3 years ago

greggyb · @greggyb
21 followers · 27 posts · Server mastodon.sdf.org

Day 10 of in gives us another accumulation of states in a list!

Today we play the part of a CRT display. Once again, a good exercise in list manipulation with a couple wrinkles around state representation and index bases.

Follow along and check out my code: antifound.com/posts/advent-of-

adventofcode.com/2022/day/10

#adventofcode #powerbi #PowerQuery #Mlang

Last updated 3 years ago

greggyb · @greggyb
20 followers · 26 posts · Server mastodon.sdf.org

Day 9 of in .

Today's challenge is another two-dimensional grid and accumulation of state. It ends up looking like the game Snake.

A good example of changing the cardinality of a fact table between the two halves.

Follow solutions and code: antifound.com/posts/advent-of-

adventofcode.com/2022/day/9

#adventofcode #powerbi #Mlang #daxlang #PowerQuery

Last updated 3 years ago

greggyb · @greggyb
34 followers · 49 posts · Server mastodon.sdf.org

Day 7 of in

1. Much more involved and stateful parsing of the input. This lets us stretch our legs on writing functions to build a solution.
2. Realistic and useful representation of a filesystem if you ever need this in PBI -- a good example of an unwound hierarchy for .
3. Found a severe memory leak in M Intellisense.

Follow along and find solutions on my blog: antifound.com/posts/advent-of-

adventofcode.com/2022/day/7

community.powerbi.com/t5/Issue

#adventofcode #powerbi #Mlang #daxlang #PowerQuery

Last updated 3 years ago

greggyb · @greggyb
33 followers · 46 posts · Server mastodon.sdf.org

Day 6 of in is very straightforward. It is a good example of basic string munging in .

Follow progress and solutions on my blog: antifound.com/posts/advent-of-

adventofcode.com/2022/day/6

#adventofcode #powerbi #Mlang #PowerQuery

Last updated 3 years ago

greggyb · @greggyb
33 followers · 42 posts · Server mastodon.sdf.org

Today's in was the most fun I have had in in quite some time!

It provides a great example of functional patterns for iterative processing. The hard parts are defining a good state representation and a single step function. With these, everything else goes swimmingly.

Also a good example of how to handle ASCII art in code.

Follow along with my progress and find solutions: antifound.com/posts/advent-of-

adventofcode.com/2022/day/5

#adventofcode #powerbi #Mlang #PowerQuery #etl

Last updated 3 years ago

greggyb · @greggyb
33 followers · 41 posts · Server mastodon.sdf.org

Day 4 of in .

Another day, another set problem. Today’s pushes you to a sparse set representation, capturing just upper and lower bounds of contiguous sets of numbers. You could do it with dense sets, too, but that would feel too much like yesterday’s!

Follow commentary and solutions on my blog: antifound.com/posts/advent-of-

adventofcode.com/2022/day/4

#adventofcode #powerbi #PowerQuery #Mlang

Last updated 3 years ago

greggyb · @greggyb
30 followers · 40 posts · Server mastodon.sdf.org

Day 3 of in .

All about grouping and set operations (and vindication for 0-indexing) in / and .

Good exercise in preserving valuable source information through as well.

Take a look and follow along on my blog (code and solutions available): antifound.com/posts/advent-of-

adventofcode.com/2022/day/3

#adventofcode #powerbi #PowerQuery #Mlang #daxlang #etl

Last updated 3 years ago

greggyb · @greggyb
31 followers · 40 posts · Server mastodon.sdf.org

Today's in proves the value of a good lookup or reference table in preparing data. Rather than calculate rock-paper-scissors scores, we can just store the 9 possible plays between two opponents and their scores. No code to understand RPS, just a join and a sum.

Follow along on my blog with link to my solution file and code antifound.com/posts/advent-of-

adventofcode.com/2022/day/2

#adventofcode #powerbi #PowerQuery #Mlang #etl

Last updated 3 years ago

greggyb · @greggyb
24 followers · 36 posts · Server mastodon.sdf.org

I am doing this year’s Advent of Code in with and

Follow along with my progress at antifound.com/posts/advent-of-

Today’s (and future) solutions can be found in my AOC pbix file. It is a good example of dealing with source data that is grouped positionally and delimited with blank data rows. antifound.com/assets/aoc2022.p

adventofcode.com/2022/day/1

#powerbi #PowerQuery #Mlang #daxlang #adventofcode

Last updated 3 years ago

greggyb · @greggyb
24 followers · 36 posts · Server mastodon.sdf.org

Fun calendar request from a client: week numbers for Friday-Thursday weeks.

1. Start withThursdays only (week-ends)
2. Group by year
3. Add index column to per-year grouped table
4. Ungroup
5. Backfill all dates

The important insight is not to start with all dates and try to figure out where they belong, but to start only with the concept of weeks and add the rest of the dates in a later step after numbering the weeks.

Code: paste.sr.ht/~greggyb/86c53d6a0

#PowerQuery #powerbi #Mlang #etl

Last updated 3 years ago