Forum Discussion

RobertSlattery's avatar
RobertSlattery
Responsive Resident
3 years ago
Solved

Confusing behaviour of OFFSET function

I finally figured out (or at least I think I did) that the preservation of the data lineage of the output row is the issue. The measure running in the OFFSET filter context, will reference the output...
  • AlbertoFerrari's avatar
    3 years ago

    Well, the short answer is "yes" 🙂

    Window functions return a row in their source table. The external context is used only to determine what the current row in the source table is. Consequently, their lineage is that of the source table.

    If you mix in the matrix fact and dim columns, it just becomes a mess. Add to it that ALLSELECTED is nearly always there, it is the perfect recipe for some hours spent trying to understand what is happening with the filter context.

    Keep in mind: window functions are designed to be powerful, not simple. They require some getting used to.

    Anyway, thanks for the question, it clearly shows you have a sound understanding of the DAX principles, I love these questions when I see them.