-1

I have 2 date fields in my fact table start_date and end_date. Fact table is connected to the dim date with start_date. I need to slice data by the second date field so I've created another date dimension similar to the first dim date and connected the key to the end_date in the fact table, but for some reason there's no relation between them when I browse the cube.

I made sure the keys are in the same format, data type etc. The new dim date is 'marked as date table'. What am I missing?

Thanks a lot.

  • 1
    Hi - please tag your question with the database you are using. Also, why have you created a 2nd date dimension rather than linking both date columns to the same date dimension? – NickW Nov 18 '20 at 12:05
  • Hi, 1. what do you mean by tagging the DB? 2. I created a 2nd dim because I want to slice the fact table with the end_date and have an active relationship. – Gilladriel Nov 18 '20 at 12:54
  • Add a tag to your question so that we know which database you are using: Oracle, SQL Server, MySQL, etc. – NickW Nov 18 '20 at 12:58
  • You can create multiple relationships between two tables. You don't need to create a 2nd Date table if you have 2 relationships between the fact table and the Date table – NickW Nov 18 '20 at 13:00
  • You mean I should use USERELATIONSHIP? because I need to slice the fact with the end_date field. – Gilladriel Nov 18 '20 at 13:23
  • Hi - it would be really helpful if you clearly stated what technology stack you are using and where in this stack you are actually trying to develop this functionality. I'm guessing that as you've now mentioned USERELATIONSHIP that you are working in PowerBI or SSAS. If this is the case then this is very different from working with the underlying database, which is what your original question implied you were doing – NickW Nov 18 '20 at 13:31
  • My title starts with "Tabular" ... – Gilladriel Nov 18 '20 at 13:35
  • and...? Do you think "tabular" defines a specific product or technology? Dictionary definition: "having the form of a table". I think i'll probably leave this conversation at this point but please tag your question with the actual product you are using if you want someone else with the relevant skills to help you – NickW Nov 18 '20 at 13:50

1 Answers1

0

Try with TabularEditor: https://github.com/otykier/TabularEditor/releases/tag/2.13.0

open your Model and check relationships if you don't see the one you want, you can just add a new one. enter image description here

You can also create multiple relationships to the same table using different columns (but as inactive), you can use this inactive relationship in calculation using USERELATIONSHIP.

msta42a
  • 3,601
  • 1
  • 4
  • 14