Forum Discussion
Dimdate table isn't working
- 8 months ago
You have a few options to fix it:
1. Use a truly unique key for the relationship
Instead of MonthNumber, use a column like:
- FullDate (YYYY-MM-DD)
- DateKey (e.g., 20250101)
- YearMonth (e.g., 202501)
These are unique at the date or month level and are suitable for the one-side of a relationship.
2. Create a unique Year-Month key
If your fact table is at a monthly granularity, create a new column in DimDate:
YearMonth = dimdate[Year] * 100 + dimdate[MonthNumber]
This will ensure values like 202501, 202502, etc., which are unique.
Hi IffyN
I’m Jaywant. You’re seeing that error because the column you used as the key in your date table is not unique (the message says MonthNumber contains duplicate value 1), and semantic-model relationships require the “one” side to have unique values. Lets do some checks:
Confirm your date table in the lakehouse: does it have a unique date column? If not, regenerate it (see pyspark snippet).
Add the lakehouse table to the semantic model (Model → Add table → Lakehouse → pick dim_data).
Rename columns to clean names (no HTML tags).
Create relationship in the semantic model: join Fact[DateColumn] -> DimDate[Date]. Make sure the direction is appropriate (single-direction unless you need bi-directional).
Mark as date table (if you’re in Power BI Desktop: right-click table → Mark as date table → select Date column). In Fabric semantic model check the date settings too.
Refresh metadata in Power BI Desktop or Fabric model viewer (sometimes you need “Refresh” / re-import metadata).
Test visuals again — error should vanish.
Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!
Jaywant Thorat | MCT | Data Analytics Coach
Linkedin: https://www.linkedin.com/in/jaywantthorat/