cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper I
Helper I

Creating a Date Table with only months and Years

Hello I want to create a Date Table with the following format : 

 

MONTH :  format whole number (1-12)

YEAR: start year: from two tables f_final & f_mvt, source column YEAR whole number

FullDate : 1st day of each month ex 01/01/2014 , 01/02/2014 ...

ID_DATE: YEAR*100+MONTH

 

Thank you,

1 ACCEPTED SOLUTION
Super User II
Super User II

@adnane_k 

maybe you can try this

Table = 
VAR TBL=ADDCOLUMNS(CALENDARAUTO(),"month",month(''[Date]),"year",year(''[Date]),"ID_Date",year(''[Date])*100+month(''[Date]),"fulldate",date(year(''[Date]),month(''[Date]),1))
RETURN SUMMARIZE(TBL,[month],[year],[ID_Date],[fulldate])

 1.PNG





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

1 REPLY 1
Super User II
Super User II

@adnane_k 

maybe you can try this

Table = 
VAR TBL=ADDCOLUMNS(CALENDARAUTO(),"month",month(''[Date]),"year",year(''[Date]),"ID_Date",year(''[Date])*100+month(''[Date]),"fulldate",date(year(''[Date]),month(''[Date]),1))
RETURN SUMMARIZE(TBL,[month],[year],[ID_Date],[fulldate])

 1.PNG





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

Helpful resources

Announcements
secondImage

Congratulations!

We are excited to announce the Power BI Super Users!

Wave Release 2

Check out the updates in Power BI.

Overview of Power BI 2020 release wave 2!

Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

Mark your calendars and join us for our next Power BI Dev Camp!.

secondImage

The largest Power BI virtual conference

100+ sessions, 100+ speakers, Product managers, MVPs, and experts. All about Power BI. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors