Forum Discussion
liudmila
5 years agoFrequent Visitor
DAX UNION does not work as expected
Hi, I need to create a table ,every row comes from different sources. first row from cube1, second row from cube2 etc. I created a custom table using UNION Customers=UNION(table1,table2,table3,ta...
- 5 years ago
Hi Anonymous thank you very much for your suggection. It was sorted. UNION did not work for me so I found the example in internet and it solved my problem
instead of using just Union (table1, table2,table3, table4)
I used Union(table21, table2,table3, SELECTCOLUMNS ( Table4, "Column1", Table4[Column1], "Column2", Table4[Column2], "Column3", Table4[Column3] ) and it works!!!!
)
liudmila
5 years agoFrequent Visitor
2 tables were joined by using DAX NATURALLEFTOUTERJOIN
table4 =
VAR A =
SELECTCOLUMNS (
Sales,
"Month_Year", Sales[Processed date.Month] & Sales[Processed date.Year],
"ProcessedAt" , Sales[Processed date.DateValue],
"Region", Sales[Site.Region]
)
VAR B =
SELECTCOLUMNS (
Forecast,
"Month_Year", Forecast[Processed date.Month] & Forecast[Processed date.Year],
"AU OOH", Forecast[AU OOH],
"UK OOH",Forecast[UK OOH]
)
var Result = NATURALLEFTOUTERJOIN ( A, B )
return Result