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!Get 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!