on 10-11-2016 03:32 AM
I have a data model with two tables.
First table is the calendar where every row contains a date of the calendar. Obviusly, same date doesn't repeat in another row.
The other table contains sales and there is another field for date. In this case, date can be repeated in different rows.
I have created a relationship between these two fields. But I don't know which type of relationship must choose. (one-to-one, one-to-many,many-to-one)??
on 10-11-2016 03:34 AM
You should do a 1:n (one to many) relationship from your date field in the calendar table to the date field in the sales table.
Please always mark accepted solutions. It helps others with similar questions or problems. Thank you.
on 10-11-2016 12:28 PM
If you use the table view and drag and drop the fields between to tables, Power BI usually sets the join type for you. You can double click on the join line to check and modify the join properties at any time.
on 10-11-2016 02:36 PM
Thank you, @GarryFarrell
The problem was when I use the table view, the relationship sets the join one to one... Sure It was something unusual!!!!
10-11-2016 02:53 PM - edited 10-11-2016 02:55 PM
It's because you probably didn't have lots of data in your tables or possibly you didn't have any data at all. One thing that Power BI looks at to detect the relationships is the tables' data. So if , for instance, you have one sales row in your Sales table per for Order Date, then Power BI detect a One-to-One relationship between those two tables.
But, you can always modify the relationships.