A matrix is filtered by a slicer as well as several report-level and visual filters. Using DAX Studio I captured the report query used to render the matrix, and returns correct data. And If I drill down on rows, the lowest level of detail is also correct.
However, when I export underlying data to Excel, it is returning thousands of rows that are not constrained by the relationships in the model. I captured the export query, and it's adding a table variable called __DS0PrimaryPreShowAllShowAllCompat which it UNIONs with a table variable called __DS0PrimaryPreShowAllReordered. The variable __DS0PrimaryPreShowAllShowAllCompat consists a CALCULATETABLE function with several nested CALCULATE, FILTER, VALUELS, SUMMARIZE, ISBLANK, GENERATE, VALUES, and KEEPFILTERS functions. However, it's causing rows from one of the related tables to appear that aren't in the filter scope of the matrix.
If I comment out the __DS0PrimaryPreShowAllShowAllCompat variable and remove it from the UNION function, the results are what is expected, matching the summarized data, only within the scope of the filter values. In this case it's causing problems for our customers in that it's returning dimension rows unrelated to the relevant facts.
Can someone please advise whether I can disable to generation of the offending variable?