greggyb · @greggyb
37 followers · 101 posts · Server mastodon.sdf.org

@ruthpozuelo

Specifically, if you can write something that looks like below, this implies that the function *must* return a table.

CALCULATE ( [measure], OFFSET ( ... ) )

The setfilter args to CALCULATE must be one of:

1. A table expression
2. A simple predicate that references a column
3. One of the ALL family

If the arg is a function call, that function must return a table or be in the ALL family. Simple predicates are translated to FILTER expressions, which returns a table.

#daxlang

Last updated 3 years ago

greggyb · @greggyb
37 followers · 101 posts · Server mastodon.sdf.org

@ruthpozuelo

INDEX and OFFSET return a single row. If this is a row from a one-column table, then it will be implicitly converted to a scalar if used in a context where a scalar is expected. This is normal behavior for table-valued functions.

WINDOW returns arbitrarily many rows depending on the context it is called in.

Using a fixed number for the first parameter of INDEX seems to me to be roughly equivalent to just writing it as a simple setfilter predicate for CALCULATE.

#daxlang #dax

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
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
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