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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Getting order date dates in Calendar table

Hi all,

I want to build a calendar table which will have dates from Order date column in Order table.
Order date column will have uneven dates , like it may have April 1,2,3, but may not 4, some dates will be missing 
and in some cases some months in some years will also be missing

Please help

Thanks in advance

1 ACCEPTED SOLUTION

Hi @Anonymous , 

 

you can create a date table based on your order table like that; 

 

Date Table= CALENDAR(MIN('order'[date]),MAX('order'[date]))

 then if you generate relationship between Date Table[date] and order[date] by both direction, you can reach your target.

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi @Anonymous ,

I'm a little confused about your needs, Could you please explain them further? It would be good to provide a screenshot of the results you are expecting and desensitized example data.

Thanks for your efforts & time in advance.

 

Best regards,
Community Support Team_Binbin Yu

OguzMavice
Resolver II
Resolver II

Hi @Anonymous , 

 

When creating standart date table by dax, we need to make some edition on it. Below code, I added two line codes apart from classic date tabe dax. Let me mark them with bold format.

First , I created "Selection" column in order to filter uneven day number, and I used "Mod" function. If Mod(number,2)=1 , it means number is uneven. 

 

Then, I filtered out this uneven day numbers like selection=1. 

 

I am adding final result of data as image at below. Please follow the day number column in the image, which is your target.

DAX DateTable =
var table1=ADDCOLUMNS (
    CALENDAR(DATE(2024,1,1), DATE(2024,12,31)),

    "Year", YEAR([Date]),
    "Quarter", "Q" & FORMAT(CEILING(MONTH([Date])/3, 1), "#"),
    "Quarter No", CEILING(MONTH([Date])/3, 1),
    "Month No", MONTH([Date]),
    "Month Name", FORMAT([Date], "MMMM"),
    "Month Short Name", FORMAT([Date], "MMM"),
    "Month Short Name Plus Year", FORMAT([Date], "MMM,yy"),
    "DateSort", FORMAT([Date], "yyyyMMdd"),
    "Day Name", FORMAT([Date], "dddd"),
    "Details", FORMAT([Date], "dd-MMM-yyyy"),
    "Day Number", DAY ( [Date] ),
    "Selection",MOD(DAY ( [Date] ),2)
)
var table2 = CALCULATETABLE(table1,FILTER(table1,[Selection]=1))
return table2
 
OguzMavice_0-1700399036040.png

 

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

Anonymous
Not applicable

Hi @OguzMavice 

My order date has years like in below picture

Bharathi_99_0-1700408015809.png

if I select only 2008, it have only date 3/31/2008 that's it

So I just want to show whatever dates in Order date in Calendar table

Please reply,
Thanks

Hi @Anonymous , 

 

you can create a date table based on your order table like that; 

 

Date Table= CALENDAR(MIN('order'[date]),MAX('order'[date]))

 then if you generate relationship between Date Table[date] and order[date] by both direction, you can reach your target.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors