Coming back to the example I've describe in my first post => I've created a Power BI report with two identical matrix visuals => one of them is behaving as I would expect, the other one isn't.
Link to Power BI report (incuding the DAX queries I'm referring to underneath): Problem Matrix Table Bis.pbix
I examined the DAX queries used by both visuals and the strange thing that I notice, is that for one of the matrix visuals, a NONVISUAL function is added to the query. So alhough both matrices are identical, for an unexplainable reason, Power BI added the NONVISUAL function to one of the matrices.
The query as I expected him (working matrix):
************
DEFINE
VAR __DS0FilterTable =
TREATAS({"D",
"A"}, 'Data'[Customer ])
VAR __DS0Core =
SUMMARIZECOLUMNS(
ROLLUPADDISSUBTOTAL('Data'[Status], "IsGrandTotalRowTotal", 'Data'[Prio], "IsDM1Total"),
__DS0FilterTable,
"v__Qty", '_Measures'[# Qty],
"Total_All_Prio", '_Measures'[Total All Prio]
)
VAR __DS0PrimaryWindowed =
TOPN(502, __DS0Core, [IsGrandTotalRowTotal], 0, 'Data'[Status], 1, [IsDM1Total], 0, 'Data'[Prio], 1)
EVALUATE
__DS0PrimaryWindowed
ORDER BY
[IsGrandTotalRowTotal] DESC, 'Data'[Status], [IsDM1Total] DESC, 'Data'[Prio]
************
The query that creates bizarre results:
************
DEFINE
VAR __DS0FilterTable =
TREATAS({"D",
"A"}, 'Data'[Customer ])
VAR __DM3FilterTable =
TREATAS({"Active",
"Passive"}, 'Data'[Status])
VAR __DS0Core =
SUMMARIZECOLUMNS(
ROLLUPADDISSUBTOTAL(
'Data'[Status], "IsGrandTotalRowTotal",
// Question: why is NONVISUAL appearing here?
'Data'[Prio], "IsDM1Total", NONVISUAL(__DM3FilterTable)
),
__DS0FilterTable,
"v__Qty", '_Measures'[# Qty],
"Total_All_Prio", '_Measures'[Total All Prio]
)
VAR __DS0PrimaryWindowed =
TOPN(502, __DS0Core, [IsGrandTotalRowTotal], 0, 'Data'[Status], 1, [IsDM1Total], 0, 'Data'[Prio], 1)
EVALUATE
__DS0PrimaryWindowed
ORDER BY
[IsGrandTotalRowTotal] DESC, 'Data'[Status], [IsDM1Total] DESC, 'Data'[Prio]
************
So question remains: what causes the NONVISUAL function to be added?
Many thanks!!!