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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
melodypoh
Frequent Visitor

Create relationship without unique IDs

Hi, I am trying to compare sales from August 2017 (file 1) to August 2015 and 2016 (file 2). I can't connect them because there are duplicated SKUs sold all the time. How would you guys may go about this?

9 REPLIES 9
Ashish_Mathur
Super User
Super User

Hi,

 

So assuming you have 3 datasets each with 2 columns - Date and SKU's.  You must do the following:

 

  1. Create a calendar table and build a relationship from the date column of each dataset to the calendar table
  2. From all 3 datasets, create a master list of unique SKU's (can be done using Append and Remove duplicates feature of Power Query)
  3. Build a relationship from the SKU column of each dataset to the unique list of SKU's dataset created in 2 above

 

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi Ashish, How do you build a relationship using the date column? They are all different dates right? It's been a long time since I touched SQL. I feel like I am starting over again.

Hi,

 

Once you have a date column in each dataset, you have to go to Modelling > Manage relationship and create a relationship from the date column of each dataset to the date column of the calendar table.  Please read up on how to create a relationship in Power BI desktop/PowerPivot.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi Ashish, 

 

There are 2 datasets, one is for this year, the other one has the last 2 years' data. I don't think I should delete duplicated SKUs because each has its unique order number which differs year to year.

Anonymous
Not applicable

Connect them both to a shared calendar table that contains all dates for both years, then compare Augusts from there.

Hi there, thanks for your help. I am gonna have to look into how to create a shared calendar table.

Hi @melodypoh,

There must be a min and max date in the three datasets. Please create a calendar table using the formula.

Calendar=CALENDAR([MinDate], [MaxDate])


Best Regards,
Angelia

Hi Angela,

 

I am new to Power BI. Once I create a shared calendar table, how do I merge the two database together?

Hi @melodypoh,

You need to create a relationship between Calendar to file1(database1), another relationship between Calendar to file2(database2), how to create relationship, please review this article: https://powerbi.microsoft.com/en-us/documentation/powerbi-desktop-create-and-manage-relationships/.

Best Regards,

Angelia

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.