Forum Discussion
marama
Helper I
4 years agoNATURALLEFTOUTERJOIN and different data types issue
Hi!
I've spent 2 hours trying to figure out why this code throws an error.
So I'm joing 2 summarized tables, using the ym (date type) and team_id (int) as relationship.
How can I verify the kelationship keys are really of the same type?
tab_vcu_team =
VAR A =
SELECTCOLUMNS(
SUMMARIZE(v_pbi_projects_ym
, v_pbi_projects_ym[ym]
, v_pbi_projects_ym[team_id]
, "revenue", SUM(v_pbi_projects_ym[valueadded])
)
, "ym", [ym], "team_id", [team_id], "revenue", [revenue])
VAR B =
SELECTCOLUMNS(
SUMMARIZE(v_pbi_person_ymd
, v_pbi_person_ymd[ym]
, v_pbi_person_ymd[team_id]
, "cost", SUM(v_pbi_person_ymd[cost_day])
)
, "ym", [ym], "team_id", [team_id], "cost", [cost])
VAR Result =
NATURALLEFTOUTERJOIN ( A, B )
RETURN
Result
Error.
"An incompatible join column, (''[ym]) was detected. 'NATURALLEFTOUTERJOIN' doesn't support joins by using columns with different data types or lineage."
1 Reply
- DataInsights
Super User
This looks like a lineage issue. Try using TREATAS as explained in the link below:
https://www.sqlbi.com/articles/from-sql-to-dax-joining-tables/