Power bi:将多张表合二为一 [英] Power bi: combine multiple tables into one
问题描述
我有三个表,其结构如下-
I have three tables whose structure is as follows-
表 1-
表 2-
表 3-
我想要一张这样的桌子 -
I wanted to have a table like this -
我尝试了这个特殊的公式来创建计算表-
I tried this particular formula for creating a calculated table-
Table = UNION(SELECTCOLUMNS(Table1,"Table1", Tables[Table1]), SELECTCOLUMNS(Table2, "Table2 Totals", Table2[Totals]), SELECTCOLUMNS(Table3, "Table3 Totals", Table3[Totals]))
我得到的结果是这样的:-
The result I am getting is like this:-
我不知道为什么会这样.在这种情况下该怎么办?计算列不出现在合并查询中吗?
I have no idea why this is happening. What to do in this scenario? Do calculated columns not come in merge query?
推荐答案
我会创建 2 个新表,然后基于 Table1 Column1 加入它们.
I would create 2 new tables and then join them based on Table1 Column1.
我将创建的 2 个新表是NewTable1:Table1 Col2 和 Table2 Col1NewTable2:Table1 Col3 和 Table3 Col1
The 2 new tables I would create are inner joins of NewTable1: Table1 Col2 and Table2 Col1 NewTable2: Table1 Col3 and Table3 Col1
之后,在 Table1Col1 和 NewTable1 上创建新的合并查询然后再用一次 NewTable2.
Afterwards, create merge queries as new on Table1Col1 and NewTable1 Then one more time with NewTable2.
如果您想让我澄清一下,请告诉我,希望该过程得到充分解释,以提供总体思路/方向.
Let me know if you'd like me to clear it up, hoping the process is explained well enough to give a general idea/direction.
这篇关于Power bi:将多张表合二为一的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!