Forum Discussion

deb_power123's avatar
deb_power123
Helper V
4 years ago
Solved

Date table using calculated measures and columns

Hi All,   I need to create a Date Table [Data Table] using any possible DAX measures or DAX calculated columns. I need the output in the below expected format.Please suggest.   so I basically wan...
  • amitchandak's avatar
    amitchandak
    4 years ago

    deb_power123 , try like

     

    Date2 = var _1 = ADDCOLUMNS( CALENDAR(date(2019,01,01), date(2021,12,31) ), "Year", year([date]) , "Month Start Date", eomonth([date],-1)+1, "Month End Date", eomonth([date],0), "Month", format([DAte],"MMMM"), "Previous Month Start Date", eomonth([date],-2)+1, "Previous Month End Date", eomonth([date],-1), "Previous Month", format(eomonth([date],-1),"MMMM"))
    return SUMMARIZE(_1,[Year],[Month Start Date],[Month End Date],[Month],[Previous Month],[Previous Month Start Date],[Previous Month End Date])

     

    if needed you can simply return _1 , no need of summarize