Forum Discussion

Victormar's avatar
Victormar
Helper V
4 years ago
Solved

Defining date relationships without having a date field

Hi all,   I am working in a project where I pull data from many different excel sheets, the kicker is that non of this excels has a date field, they have many months and years, and I would to creat...
  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi Victormar .

    1)If you have month and year in your table, then you can create a Date Column using DAX like ;
    Date=DATE(Table[Year],Table[Month],1).
    2)Create a Date table and then try to create a relationship between the tables.

    3)If your data hierarchy is like one field in one table refers to many fields in another table, then you will have to create a 'Many to Many' relationship as other relationships would throw an error.
    4)Although it is not advisable to create a 'Many to Many' relationship, if your data is such then you can create a relationship and have the cross filter direction as dimension table filters fact table.
    Don't have a cross filter direction as 'both'.
    5)If you still don't want to go for 'Many to Many', then you can refer the below links;
    https://community.powerbi.com/t5/Desktop/Avoiding-Many-To-many-relationships/m-p/675653
    https://www.burningsuit.co.uk/dealing-with-many-to-many-relationships/




    Thanks,
    Sanket

    If this post helps, then mark it as 'Accept as Answer' and give it a thumbs up.