Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I'm just trying to grasp the basic concepts, but - I have to say - the amount of conflicting information I see makes it really, really confusing.
So let me get this straight about the SUM function:
Thanks in advance!
🙂 It really frustrates anyone at the beginning!
In the background evaluation process, DAX treats them as one and the same.
But, for the users, the rule of thumb is:
SUM is an aggregator function and ignores Row context!
SUMX is there for iterations (simply means row context).
Hi there!
1. It operates in a filter context when used in a measure.
2. The SUM funcion is an aggregator, SUMX and every other "X" function are iterators.
Thank you! Perhaps I phrased point one incorrectly. What I meant to say is: does it create (or work with) a row context or filter context?
Here is a quote from an article that adds to my confusion:
Another common mistake of DAX newbies is thinking that SUM and SUMX are two different functions. This is not the case. SUM is nothing but a simplified version of SUMX: we call it syntax sugar. SUM ( Sales[Quantity] ) is internally translated into SUMX ( Sales, Sales[Quantity] ). Therefore, a regular aggregator like SUM, AVERAGE, MIN or MAX behaves the same way an iterator does.
This is the reason why a calculated column computing SUM ( Sales[Quantity] ) produces the grand total of Sales[Quantity] on each row. […]
[…] The row context does not filter, it iterates.
This definitely implies that SUM creates (works with) a row context and is an iterator.
I suggest you watch this videos from SQLBI as I believe there is no better content out there.
Hope this clarify this concepts, they are not easy to understand at first.
The Whiteboard Playlist
User | Count |
---|---|
25 | |
11 | |
8 | |
6 | |
6 |
User | Count |
---|---|
30 | |
13 | |
11 | |
9 | |
6 |