我想使用两个表表1和表2创建差异列,我想使用DAX公式创建具有计数列差异的表3
Table3 = ADDCOLUMNS( DISTINCT(UNION(VALUES(Table1[Product]), VALUES(Table2[Product])) ), "@Diff", VAR a = LOOKUPVALUE(Table1[Count], Table1[Product], Table1[Product]) VAR b = LOOKUPVALUE(Table2[Count], Table2[Product], Table1[Product]) RETURN a-b )
Table3 = SUMMARIZECOLUMNS( Table1[YourKeyColumn], "Count_Table1", COUNTROWS(Table1), "Count_Table2", CALCULATE(COUNTROWS(Table2)) "Difference", [Count_Table1] - [Count_Table2] )