Forum Discussion

kky1's avatar
kky1
Icon for Helper II rankHelper II
4 years ago
Solved

Help adding column from another table with many to many relationship

I am stumped trying to add a column from one table to another which have a many to many relationship. The two tables are for a calendar visual - one table has date/time start times and the other has...
  • kky1's avatar
    4 years ago

    Hello - I figured out a solution for this which I'll post for anyone such as myself who is still in the learning stages of DAX. I'm sure it's not the most efficient way, but it worked for me.

     

    I did a merge tables action which created a table with all of the data. In the new Merge table, I redid the calculations to gather the current weekday and created a date/time field for start and end dates. This created a table with a huge amount of duplicates where the start day name and end day names didn't match due to the many to many relationship.

     

    So, I created a new column within the table to compare the two day names with "Yes" if they matched and "No" if they didn't. Then I just created a filter on my visual page for only those with a "Yes". This did the trick. Below are screenshots in case this helps anyone. 

    Merged table with many values from the start time and end time table;

     

    Added column to merged table to check if the day names matched.

     

    Finished calendar now shows one entry per employee per day.