Created by: Paul Pitcher
Creation Date: Aug 16, 2025
Updated Date: Oct 14, 2025

Functions

(also called: )

One group of functions are called "X Functions". They are iterators. They go row by row
Here are some examples: SUMX, MINX, MAXX, AVERAGEX, COUNTX,
Tip: They also work backwords
So for example
SUMX
The "X" portion happens first (the iteration)
The "SUM" operation happens last. I think if you are using several functions, the sum will happen after all of them. I think that this might be like a "group by" where it happens at the end of the SQL statement.

Here is an example:
Here is the DAX code
SUMX (, )
and here is how we are going to read it
X (table) -> expression -> SUM
source: Power BI: How to Write any DAX Measure In Just 3 Easy Steps
Note: I remember having a job interview and they asked me what the difference between SUM and SUMX. Wow what I didn't know.

Q: how does the VALUES function work? it grabs all of the data from a column and converts it into a table. This is very helpful and used a lot.
Q: how does the FILTER function work?
A: Even though this function doesn't have a X in the name, it operates like the other X functions in that it iterates first before the "FILTER" operation happens.
CALCULATE = works outside -> in
The "Outer" Filter parameters are evaluated first. So I think that this is like python. Where the inside stuff is ran before the outside stuff. Maybe this is also similar to a subquery runs first before the outside query runs.
in this example the "Outer" filter parameters are evaluated first...
CALCULATE (<expression> [,<filter1> [, <filter2> [, ...]]] )
The "Inner" expression is evaluated last.