Forum Discussion

EltonjohnWick's avatar
EltonjohnWick
Frequent Visitor
2 years ago
Solved

Duplicate week error with custom date hierarchy table

Hi,  I had created a date hierarchy table manually, as the dax calandar function weeks don't tie in with my working weeks.   The table has the following rows: week, month, quarter and year. The ca...
  • Anonymous's avatar
    Anonymous
    2 years ago

    HI EltonjohnWick 

     

    When you added the year 2024 to your table, you created a situation where the 'week' column has duplicate values (e.g., week '1' for 2023 and week '1' for 2024). If this column is used in relationships or as a primary key in your data model, these duplicates can cause problems.

     

    Instead of using the 'week' column alone as a key, create a unique identifier for each row in your date hierarchy table. This identifier could be a combination of the year and week. For example, you can create a new column named 'YearWeek' that concatenates the year and week number (like '2023-W01', '2023-W02', ..., '2024-W01', etc.).

     

     

     

    Best Regards,

    Jayleny

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.