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
Ashoop2020
Frequent Visitor

Creating a Calendar Table with the First date based on column value

Hello! 

 

I am looking to create a calendar table that starts with the first date in the below table where the Print Drop Column = Yes, and the last date is the last date in the below table. 

 

Screenshot 2022-12-15 101116.png

 I know how to create the table I am just not sure how to implement a condition with the "FIRSTDATE" function. 

 

Thanks!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Ashoop2020 ,

You can create a calculated table as below, please find the details in the attachment.

Calendar = 
VAR _mindate =
    CALCULATE ( MIN ( 'Table'[date] ), 'Table'[Print Drop] = "Yes" )
VAR _maxdate =
    CALCULATE ( MAX ( 'Table'[date] ), 'Table'[Print Drop] = "Yes" )
RETURN
    CALENDAR ( _mindate, _maxdate )

yingyinr_1-1671177178534.png

Best Regards

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @Ashoop2020 ,

You can create a calculated table as below, please find the details in the attachment.

Calendar = 
VAR _mindate =
    CALCULATE ( MIN ( 'Table'[date] ), 'Table'[Print Drop] = "Yes" )
VAR _maxdate =
    CALCULATE ( MAX ( 'Table'[date] ), 'Table'[Print Drop] = "Yes" )
RETURN
    CALENDAR ( _mindate, _maxdate )

yingyinr_1-1671177178534.png

Best Regards

WinterMist
Impactful Individual
Impactful Individual

@Ashoop2020 

 

For a sound Date Table, this is not recommended.  For date-time functions to work, DAX is very picky and demands that the date table begin on January 1st & end on December 31st.

 

Are you 100% sure this is what you want to do?

 

Regards,

Nathan

 

 

https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/

 

WinterMist_0-1671121955199.png

 

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.