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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
bhmiller89
Helper V
Helper V

Create Date Table based on Min/Max of Existing Data

I usually create a date table for my data using the usual way of defining specific beginning and end dates. I wanted to know if it is possible to create a date table based on the existing data. 

 

For example, I have a table that tracks service requests which all have a start date and an end date. If I want my date table to start at the MIN Service Rquest Start Date and end at the MAX Service Request Start Date, is that possible? 

1 ACCEPTED SOLUTION
venug20
Resolver I
Resolver I

@bhmiller89

 

go to ..> Model --> choose --> new table,

 

As per your requirement, use below formula to create table.

 

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

 

 

Calender-Table.jpg

 

 

If it is solution to query, accept as solution... it is useful to others....

 

View solution in original post

5 REPLIES 5
venug20
Resolver I
Resolver I

@bhmiller89

 

go to ..> Model --> choose --> new table,

 

As per your requirement, use below formula to create table.

 

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

 

 

Calender-Table.jpg

 

 

If it is solution to query, accept as solution... it is useful to others....

 

Anonymous
Not applicable

Is it possible to pull this formula created table into the "power query editor" where we can add date columns with date properties such as day of week, quarter 1, etc?  Like the screen below.

AddDateFields.PNG

Did you ever find a solution to your question? I am trying to do the same thing myself.

Try this:

 

Date = ADDCOLUMNS (CALENDARAUTO(),
"Year", YEAR ([Date]),
"Month", FORMAT([Date], "mmmm"),
"Month Number", MONTH([Date]),
"Quarter", FORMAT([Date], "\QQ")
)

this is awesome! Exactly what I was looking for.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.