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

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

Reply
raymond
Post Patron
Post Patron

Number of Days in a Month in a calculated Date Table

Hello Community, in an automated data table that looks like the example below, I was wondering how to add a column that specifies the number days in a month.

 

auto.Date_Table = 
ADDCOLUMNS (
CALENDAR ( DATE(2018 ; 01 ; 01 ); TODAY()-1 );
"DateAsInteger"; FORMAT ( [Date]; "YYYYMMDD" ) )
1 ACCEPTED SOLUTION
raymond
Post Patron
Post Patron

I found out myself thanks to this post: click

 

auto.Date_Table = 
ADDCOLUMNS (
CALENDAR ( DATE(2018 ; 01 ; 01 ); TODAY()-1 );
"DateAsInteger"; FORMAT ( [Date]; "YYYYMMDD" );
"DaysInMonth"; DAY( 
IF( 
MONTH( [Date] ) = 12 ;
DATE(YEAR( [Date] ) + 1;1;1);
DATE(YEAR( [Date] ); MONTH( [Date] ) + 1; 1)
) - 1
)
)

View solution in original post

1 REPLY 1
raymond
Post Patron
Post Patron

I found out myself thanks to this post: click

 

auto.Date_Table = 
ADDCOLUMNS (
CALENDAR ( DATE(2018 ; 01 ; 01 ); TODAY()-1 );
"DateAsInteger"; FORMAT ( [Date]; "YYYYMMDD" );
"DaysInMonth"; DAY( 
IF( 
MONTH( [Date] ) = 12 ;
DATE(YEAR( [Date] ) + 1;1;1);
DATE(YEAR( [Date] ); MONTH( [Date] ) + 1; 1)
) - 1
)
)

Helpful resources

Announcements
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