Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
lona25
Regular Visitor

Date Table

 I have four columns related to date, when I tried to mark as date table it shows error as date column must have unique columns and data column can't  have gaps. Column contains identical dates since table is about sales, on single day n number of orders can be placed. can anyone suggest the solution.

1 REPLY 1
Fowmy
Super User
Super User

@lona25 

In order for you to mark a table as date table, there are some requirements:


It must have a column of data type date (or date/time)—known as the date column.
The date column must contain unique values.
The date column must not contain BLANKs.
The date column must not have any missing dates.
The date column must span full years. A year isn't necessarily a calendar year (January-December).
The date table must be marked as a date table.


And, you youcan obviously make a fact table as  a date table as it breaks the above conditions. 
The solution and the best approach is to create a separate dates table and create a relationship to your sales table. You can use the following DAX code to create your dates table, make necessary chagnes as needed.

Dates = 
ADDCOLUMNS(
    CALENDAR("01/01/2020","31/12/2021"),
    "Month No" , MONTH([Date]),
    "Month Name", FORMAT([Date],"Mmmm"),
    "Year",YEAR([Date]),
    "Year Month No", INT(FORMAT([Date],"yyyymm")),
    "Year Month" , FORMAT([Date],"Mmm yyyy"),
    "Quarter No", QUARTER([Date]),
    "Quarter" , FORMAT([Date],"\QQ")
)




Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.