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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Kudoed Authors