Forum Discussion
Group dates to Month
Hello All,
Quick question since Im a beginner in Power Bi,
I have a range of dates in one table shown as this...
Im Interested in having a column in another table just showing the beginning of each month, like this
Thanks and regards,
Yuss
- Anonymous8 years ago
HI Yusissa,
You can use below formula to create new table with first date of each month:
NewTable= FILTER ( CALENDAR ( DATE ( YEAR ( FIRSTDATE ( 'Table'[Date] ) ), 1, 1 ), DATE ( YEAR ( LASTDATE ( 'Table'[Date] ) ), 12, 31 ) ), DAY ( [Date] ) = 1 )Regards,
Xiaoxin Sheng
2 Replies
- AnonymousNot applicable
HI Yusissa,
You can use below formula to create new table with first date of each month:
NewTable= FILTER ( CALENDAR ( DATE ( YEAR ( FIRSTDATE ( 'Table'[Date] ) ), 1, 1 ), DATE ( YEAR ( LASTDATE ( 'Table'[Date] ) ), 12, 31 ) ), DAY ( [Date] ) = 1 )Regards,
Xiaoxin Sheng
- stretcharmMemorable Member
There are lots blog posts about creating a date dimensions with any date related fields you need in M or Dax, they you can join to your table and group.
https://www.agilebi.com.au/blog/power-bi-date-dimension
http://radacad.com/create-a-date-dimension-in-power-bi-in-4-steps-step-1-calendar-columns
https://blog.crossjoin.co.uk/2013/11/19/generating-a-date-dimension-table-in-power-query/