Need some help pivoting 2 different source data tables...

Guitarmageddon

Board Regular
Joined
Dec 22, 2014
Messages
92
So Ill try to keep this concise without meandering and confusing everyone. Im kind of new to power query/pivot so forgive me if Im making some elementary oversights.

I have two different source documents, which I've brought into this workbook and added to the data model, via power query. It is basically some sales data, one is for 2019, the other for 2020. So, as you can imagine, all 2019 months are populated so far, and all 2020 months have just some February data (we work on the NRF calendar so February is our first month fyi)

I have a master table that is basically a date lookup, although date is present on both of the data tables. Since you cant have many/many, I have a master date table that basically is date/month/week number etc.

Then I draw my relationship from that date master into the two data tables. I also follow this logic with a master store number table.

However what Im wondering is, when it comes to actually pulling in the sales data, you dont need to have a master table for any of those metrics, right? If I want lets say the sales from 2019, I physically pull the data from that 2019 table into the pivot. And likewise, when I want 2020, I do the same. There isnt a way to say "grab the column called 'sales' and figure it out"? Im hoping this makes sense.

or maybe Im just overthinking it and Im correct?
date.PNG
 

Some videos you may like

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple

anvg

Active Member
Joined
Feb 14, 2012
Messages
485
Hi
Because you use Power BI you could make union both table to single one. Modeling/New Table.
Code:
Source = UNION('SOURCE_2019', 'SOURCE_2020')
To build relationship between that source union table and dimension tables. And have not a problem with creating measures for both tables.
Regards,
 

Watch MrExcel Video

Forum statistics

Threads
1,114,342
Messages
5,547,368
Members
410,790
Latest member
EvdM
Top