Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
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" ) )
Solved! Go to Solution.
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 ) )
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 ) )
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!