The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
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 ) )