Skip to main content

Posts

Showing posts from June, 2019

PowerBI Date Table

Credit -  https://www.sqlbi.com/articles/using-generate-and-row-instead-of-addcolumns-in-dax/ Expressions used below: Var , Calendar , Date , Return, Generate , Year , Month , Row , Format , Calendar 6 = VAR BaseCalendar =     CALENDAR ( DATE ( 2016, 1, 1 ), DATE ( 2018, 12, 31 ) ) RETURN     GENERATE (         BaseCalendar,         VAR BaseDate = [Date]         VAR YearDate = YEAR ( BaseDate )         VAR MonthNumber = MONTH ( BaseDate )         VAR YearMonthNumber = YearDate * 12 + MonthNumber – 1         RETURN ROW (             "Day", BaseDate,             "Year", YearDate,             "Month Number", MonthNumber,             "Month", FORMAT ( BaseDate, "mmmm" ),           ...