Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount 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 ) )