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

DAX - Calender list

Hi All,

 

I like to make a list of year from 2010 to 2030. (2010,2011,2012... 2030)

CalendarTable = CALENDAR(year(2010),year(2030))
 
Please help.
 
ALl the best,
Paris

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Post Partisan
Post Partisan

Re: DAX - Calender list

I assuem you assign start date and end date. Then you can create a calculated table with DAX. Please refer to my sample below:

 

MonthTable = 
var FullCalendar = ADDCOLUMNS(CALENDAR("2016/1/1","2017/12/31"),"Month Number",MONTH([Date]),"Year",YEAR([Date]),"Year-Month",LEFT(FORMAT([Date],"yyyyMMdd"),6),"Month Name",FORMAT(MONTH([Date]),"MMM"),"Year-MonthName",YEAR([Date]) & " " & FORMAT(MONTH([Date]),"MMM"))
return 
SUMMARIZE(FullCalendar,[Month Number],[Year],[Year-Month],[Year-MonthName])
 

 

View solution in original post

5 REPLIES 5
Highlighted
Post Prodigy
Post Prodigy

Re: DAX - Calender list

@paris 

 

TRY THIS

 

Date = CALENDAR(date(2010,01,01),date(2030,12,31))
Highlighted
Super User IX
Super User IX

Re: DAX - Calender list

@paris , Create a new table

Calendar Table = CALENDAR(date(2010,01,01),date(2030,12,31))

 

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions
https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi
https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
My Recent Blog -Week is not so Weak Connect on Linkedin

Proud to be a Super User!

Highlighted
Helper III
Helper III

Re: DAX - Calender list

Hello Vjnvinod,

 

Thank you for your message.

I tried it but it gave me daily data. I just want to have a list of year not daily. 

Is there anyway I can do?

 

All the best,

Paris

Highlighted
Post Partisan
Post Partisan

Re: DAX - Calender list

I assuem you assign start date and end date. Then you can create a calculated table with DAX. Please refer to my sample below:

 

MonthTable = 
var FullCalendar = ADDCOLUMNS(CALENDAR("2016/1/1","2017/12/31"),"Month Number",MONTH([Date]),"Year",YEAR([Date]),"Year-Month",LEFT(FORMAT([Date],"yyyyMMdd"),6),"Month Name",FORMAT(MONTH([Date]),"MMM"),"Year-MonthName",YEAR([Date]) & " " & FORMAT(MONTH([Date]),"MMM"))
return 
SUMMARIZE(FullCalendar,[Month Number],[Year],[Year-Month],[Year-MonthName])
 

 

View solution in original post

Highlighted
Frequent Visitor

Re: DAX - Calender list

Hello, I have a problem with the calender function. After adding your formula "Calender(date(2010,01,01), Date(2030,12,31)) i got the following error message: Too few arguments were passed to the date function. The minimum argument count for the function is 3.

What could be the problem? My windows date format is european.

Helpful resources

Announcements
Meet the 2020 Season 2 Power BI Super Users!

Meet the 2020 Season 2 Power BI Super Users!

Find out who's part of the program this season, and welcome the new Super Users.

August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

July 2020 Community Highlights

July 2020 Community Highlights

Learn about the exciting things that happened in July.

Featured Data Story of The Month

Featured Data Story of The Month

All Data Stories Gallery contributions are reviewed for each month. We select a contribution and feature the community member the following month.

Power BI Dev Camp - Developing with .NET Core

Power BI Dev Camp - Developing with .NET Core

Learn how to develop custom web applications for Power BI using .NET Core 3.1 and .NET 5.

Top Solution Authors
Top Kudoed Authors