Forum Discussion
Combine 2 Fact Tables With a Date Table?!
I have 1 fact table who's data is in direct query with sql server = this has 2018-2022 data
I created another table using Dax Union and row function - and used a few forecasting measures to get projections for 2023-2026.
I created another table that has one column - the combo of dates from table 1 and table 2
Please See Photo Below. there's no relationships set up yet, please help - this is very time sensitive, and I'm ready to accept solutions asap.
Hi, 7ballp25
You can try the following methods.
Table:
Date = CALENDAR(MIN('Table 1'[Date]),MAX('Table 2'[Date]))According to your description, Hist Sales and Projected Sales should both be Measure, I simulated it briefly and hope it fits your situation.
Measure:
forecasted sales measure = SUM('Table 2'[Projected Sales])historical sales measure = SUM('Table 1'[Hist Sales])Sales = [historical sales measure]+[forecasted sales measure]Is this the result you expect?
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
6 Replies
- VahidDM
Super User
HI 7ballp25
Create a new table with DAX, and use UNION formula, like this:
New Table = UNION('Table 1','Table 2')Output:
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: www.linkedin.com/in/vahid-dm/- 7ballp25Regular Visitor
Close, VahidDM ... here's the issue with that. Table 1 table has it's own measure for total sales. Call it Historical Sales Measure.
Table 2 is a dax table, and it has it's own unique "Total Projected Sales" measure based on CAGR of the most current year sales.
I did the UNION, however, when i try to combine both historical sales measure + forecasted sales measure ...all rows in the union table you sugguest display the total 170.... reference new picture i added
- VahidDM
Super User
Can you share a sample of you PBIX file?
Appreciate your Kudos!!
LinkedIn: www.linkedin.com/in/vahid-dm/
- v-zhangti
Community Support
Hi, 7ballp25
You can try the following methods.
Table:
Date = CALENDAR(MIN('Table 1'[Date]),MAX('Table 2'[Date]))According to your description, Hist Sales and Projected Sales should both be Measure, I simulated it briefly and hope it fits your situation.
Measure:
forecasted sales measure = SUM('Table 2'[Projected Sales])historical sales measure = SUM('Table 1'[Hist Sales])Sales = [historical sales measure]+[forecasted sales measure]Is this the result you expect?
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.