Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hi, I am trying to create a DAX Code where I can join columns from two tables. I have a third one but is a measure so is easy to bring, but I am not able to bring information from table 2.
They are related in my data source by a column, but I am not using it in this code. This code shows me an error when I add the bolt part
Table 1
Table 2
Table 3 - Measure Table
EVALUATE
Filter(TABLE1,
TABLE1[COLUMNFILTER1] = "Open" &&
TABLE1[COLUMNFILTER2] = "Yes" &&
TABLE1[COLUMNFILTER3] = "No" &&
TABLE1[COLUMNFILTER4] = "Yes" &&
TABLE1[COLUMNFILTER5] = "No")
EVALUATE
ADDCOLUMNS(
SUMMARIZE(
TABLE1,
TABLE1[COLUMNA],
TABLE1[COLUMNB],
TABLE1[COLUMNC],
TABLE1[COLUMND],
TABLE1[COLUMNE],
TABLE1[COLUMNF],
TABLE1[COLUMNG],
TABLE1[COLUMNH],
TABLE1[COLUMNI],
"TABLE2", RELATED (TABLE2[Column2]),
"COLUMNMEASURE", [COLUMNMEASUREVALUE])
Is Table 2 to Table 1 based on
"Column 1" from table 2
"Random column" form table 1
I dont need any of the columns as a result in my table
Hi @Aydeedglz ,
Please try:
EVALUATE
ADDCOLUMNS(
FILTER(
TABLE1,
TABLE1[COLUMNFILTER1] = "Open" &&
TABLE1[COLUMNFILTER2] = "Yes" &&
TABLE1[COLUMNFILTER3] = "No" &&
TABLE1[COLUMNFILTER4] = "Yes" &&
TABLE1[COLUMNFILTER5] = "No"
),
"TABLE2", RELATED(TABLE2[Column2]),
"COLUMNMEASURE", [COLUMNMEASUREVALUE]
)
Note that for the RELATED function to work, there must be a relationship between the two tables based on a common column. In your case, the relationship is based on "Column 1" from Table 2 and "Random column" from Table 1.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Aydeedglz
Then please try
EVALUATE
ADDCOLUMNS (
SUMMARIZE (
TABLE1,
TABLE1[COLUMNA],
TABLE1[COLUMNB],
TABLE1[COLUMNC],
TABLE1[COLUMND],
TABLE1[COLUMNE],
TABLE1[COLUMNF],
TABLE1[COLUMNG],
TABLE1[COLUMNH],
TABLE1[COLUMNI],
TABLE2[Column2]
),
"COLUMNMEASURE", [COLUMNMEASUREVALUE]
)
User | Count |
---|---|
20 | |
14 | |
11 | |
8 | |
6 |
User | Count |
---|---|
23 | |
23 | |
20 | |
15 | |
10 |