Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
7ballp25
Regular Visitor

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.

 

help1.PNG

1 ACCEPTED SOLUTION
v-zhangti
Community Support
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]

vzhangti_0-1653036274952.png

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.

View solution in original post

6 REPLIES 6
v-zhangti
Community Support
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]

vzhangti_0-1653036274952.png

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.

7ballp25
Regular Visitor

@tamerj1 you helped me with the last one, hoping you can answer this?

VahidDM
Super User
Super User

HI @7ballp25 

 

Create a new table with DAX, and use UNION formula, like this:

New Table = 
UNION('Table 1','Table 2')

 

Output:

VahidDM_0-1652314127895.png

 

 

 

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/

 

 

 

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 help2.PNG

@7ballp25 

 

Can you share a sample of you PBIX file?


Appreciate your Kudos!!
LinkedIn: 
www.linkedin.com/in/vahid-dm/

 

 

trying to figure out how to do so... dont see an option to upload pbix file on here

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.