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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Calendar Table That Takes Minimum and Maximum of a Column across Multiple Tables

Hello,

 

 

I have six tables which all contain a "RecordActiveFrom" datetime column. I'm trying to create a calendar table which uses the minimum value of all of the RecordActiveFroms as the startdate and the maximum value of all of the RecordActiveFroms as the end date.

 

I have tried editing the calendar table code in the advanced editor to take a StartDate that looks similar to "List.Min(Table1[RecordActiveFrom], Table2[RecordActiveFrom], Table3[RecordActiveFrom])" and List.Max for the maximum value but this has returned a number of different errors with date formatting and invalid values.

 

I have also tried creating a nested MIN function on a calculated column but again ran into some issues.

 

Does anyone have an efficient solution which could be used for this?

4 REPLIES 4
Greg_Deckler
Community Champion
Community Champion

I believe that you should just be able to use the DAX CALENDARAUTO function for this. My understanding of CALENDARAUTO is that it creates a calendar table by looking at the dates in the data model and creates a calendar table based upon those dates.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Hello @Greg_Deckler 

 

Does the calendarauto get bigger if we add new data out of the calendarauto?

 

For example mine begins in 2018 but I will receive data from 2016 and don't know that will happen.

 

Thank you very much,

 

DM

Anonymous
Not applicable

I think this would work but my model includes other datetime columns aside from RecordActiveFrom that I don't want to calculate the minimum or maximum for. I believe CALENDARAUTO would factor in those dates making my date range larger than needed.

dramus
Continued Contributor
Continued Contributor

The calendar DAX function will work to generate a Dates table if you can get the data into a correct Date format.

 

Date Table = CALENDAR(min('Billing Data'[Date]),max('Billing Data'[Date]))

 

I think there in lies your problem. If all of your RecordActiveFrom fields are not valid Date field, then you are going to have a problem.

 

My approach would be:

 

1) Ensure that the fields are Date (Or Date/Time) type.

2) Create measures with the minimum and maximum date fields

3) Use the CALENDAR function with the new measures. 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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