- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Relationship Three Tables
I have three tables, Sales; Forecasr and Date (autocreated, used for all tables in the file), see below sample data
I can create a relationship between Sales-Date and Forecast-Date but I also want to create a relation between Sales-Forecast for "Company" with the goal to have Stacked column per date including both Sales and forecast per company. When trying this, I recieve error that I cannot have this relation together with the relations to date since they will create an ambiguous between Sales and Data table
Any idea how to solve?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Hi @JLiljedahl
I added a dimension table for Company and made the appropriate 1:* relationships.
Let me know if you have any questions.
Proud to be a Super User!
daxformatter.com makes life EASIER!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Hi @JLiljedahl
In Power Query, I picked the table that had the most different companies duplicated the query, removed all columns other than Company, and removed duplicates. (You could to this for each table if there isn't one table that includes all companies. In this case, you would repeat the above for each table, merging the results, and removing duplicates.)
Typically you would have more company-related information other that the key itself that you could use as a dimension table.
Does this help?
Proud to be a Super User!
daxformatter.com makes life EASIER!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

@some_bih See attached sample data
I want to filter the Forecast matrix if I choose one of the companies in sales matrix and in the same way filter sales if choosing one in forecast.
https://drive.google.com/file/d/1fZ_88wsgrn4i-gqgNqv1cFNOAVvFvgBI/view?usp=drive_link
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Hi @JLiljedahl
I added a dimension table for Company and made the appropriate 1:* relationships.
Let me know if you have any questions.
Proud to be a Super User!
daxformatter.com makes life EASIER!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Could you advise on how to generate the dimension table?
Outcome seams to solve the issue I have
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Don't use CALENDARAUTO. Use CALENDAR and provide the first and last date based on the minimum and maximum date that will exist in your model.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Hi @JLiljedahl "using" Sales as actual and Forecast values could be tricky:
- if there are different level of granularity of data, like Sales on daily level but Forecast on Monhtly level- check granularity
- in your Date table there are no unique dates which are eventually in other dates tables like Sales or Forecast (maybe you have future dates for Forecast, but in Sales or Date table only actual dates) - check details
- Date table is not properly created - link for set up
-check relationships between tables
Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Hi @some_bih
- Date table is generated from Min Sales date -> Max forecast + 120days (All dates should be covered)
- Granulartiy is same, individual dates
- All dates in date table is unique
- I have a 1-Many relationship for both Date-Sales and Date-Forecast
- Whats wrong with date table?
- What could be the issue of combining Sales-Forecast?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Hi @JLiljedahl share file (dropbox, g drive... )
Did I answer your question? Mark my post as a solution!
Proud to be a Super User!

Helpful resources
Subject | Author | Posted | |
---|---|---|---|
10-04-2024 07:49 AM | |||
09-18-2024 02:24 AM | |||
12-18-2024 10:38 AM | |||
08-22-2024 11:21 AM | |||
03-29-2024 09:47 AM |
User | Count |
---|---|
137 | |
107 | |
85 | |
59 | |
46 |