Forum Discussion
Left join with three tables
Hi Trodo737
Please make sure that PowerBI is modelling the relationships correctly, both T1 and T2 and T3 and T2 should be one-to-many relationships.
Then please try the following queries or new tables expression.
DAX Query:
EVALUATE
SUMMARIZE (
CALCULATETABLE ( 'T2', 'T3'[col4] = "LastReport" ),
'T2'[col1],
'T3'[col5],
"Total", SUM ( 'T1'[col7] )
)
New Table:
TableName =
SUMMARIZE (
CALCULATETABLE ( 'T2', 'T3'[col4] = "LastReport" ),
'T2'[col1],
'T3'[col5],
"Total", SUM ( 'T1'[col7] )
)
Did I answer your question? If yes, pls mark my post as a solution and appreciate your Kudos !
Thank you~
Thanks xifeng_L
I'm totaly new in DAX. I checked it and the relationships are one-to-many:
T2 -> T1 is one-to many
T2 -> T3 is one-to-many
and T1 and T3 doesn't have any relationship.
When I use the dax code you suggested getting this error: The expression refers to multiple columns. Multiple columns cannot be converted to a scalar value.
- xifeng_L2 years ago
Super User
I'm guessing you're using either the measure or the calculated column option? Both of these options need to return scalar values, whereas I gave you the expression to create a table. Obviously, a table can't fit into a cell. So you should use the "New Table" option.
Did I answer your question? If yes, pls mark my post as a solution and appreciate your Kudos !
Thank you~