Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
I am creating a table with DAX, which is essentially joining two different tables. Sorry for the bit of a wall of DAX, but here is what I am using for reference:
Joined Table =
VAR Table1 =
GENERATE(
VALUES('Fact_Table_1'[Year-Month]),
UNION (
ADDCOLUMNS (
Column,
"Result 1", [Measure 1] - (CALCULATE([Measure 1], DATEADD(Fact_Table_1[Year-Month], -1, YEAR))),
"Calculation Type", "LY",
"Key", FORMAT (Fact_Table_1[Year-Month], "yyyymmdd" & "LY")
),
ADDCOLUMNS (
Column',
"Result 1", [Measure 1] - (CALCULATE([Measure 1], DATEADD(Fact_Table_1[Year-Month], -1, QUARTER))),
"Calculation Type", "LQ",
"Key", FORMAT (Fact_Table_1[Year-Month], "yyyymmdd" & "LQ")
),
ADDCOLUMNS (
Column,
"Result 1", [Measure 1] - (CALCULATE([Measure 1], DATEADD(Fact_Table_1[Year-Month], -1, MONTH))),
"Calculation Type", "LM",
"Key", FORMAT (Fact_Table_1[Year-Month], "yyyymmdd" & "LM")
)
)
)
VAR Table2 =
GENERATE(
DISTINCT(Fact_Table_2[Date]),
UNION (
ADDCOLUMNS (
Column,
"Result 2", [Measure 2] - (CALCULATE([Measure 2], DATEADD(Fact_Table_2[Date], -1, YEAR))),
"Calculation Type", "LY",
"Key", FORMAT (Fact_Table_2[Date], "yyyymmdd" & "LY")
),
ADDCOLUMNS (
Column,
"Result 2", [Measure 2] - (CALCULATE([Measure 2], DATEADD(Fact_Table_2[Date], -1, QUARTER))),
"Calculation Type", "LQ",
"Key", FORMAT (Fact_Table_2[Date], "yyyymmdd" & "LQ")
),
ADDCOLUMNS (
Column,
"Result 2", [Measure 2] - (CALCULATE([Measure 2], DATEADD(Fact_Table_2[Date], -1, MONTH))),
"Calculation Type", "LM",
"Key", FORMAT (Fact_Table_2[Date], "yyyymmdd" & "LM")
)
)
)
RETURN
NATURALINNERJOIN (
Table1, Table2
)
This returns my expected result, but the join function throws an error when the date columns of each fact table has the same name. As such, I had to rename one of my date columns for this to work. So my end result is a table with two identical date columns, like this example below:
Within my DAX expression, I need to refer to the date column within the relative fact table to get the correct result for the time intelligence calculations. However, it is unnecessary to include two identical date columns in the same table.
I feel like I must be missing something simple.
Is there a way I can modify my DAX to only return one date column? Or at the very least drop one of the date columns?
Solved! Go to Solution.
@markmess77 - Use SELECTCOLUMNS to overcome name duplicates.
@markmess77 - Use SELECTCOLUMNS to overcome name duplicates.
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.