Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Calender function

Hello,

I want that the calendar function creates a list of every month of eachyear between my min and max date and not a list of every day of each month of each year. Do you know how to do it pls?

Thank you!

Best regards

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi, @Anonymous 

I am not sure if I understood your question correctly, but please try something like below.

 

Picture8.png

 

Calendar Table =
SUMMARIZE (
ADDCOLUMNS (
CALENDAR ( MIN ( Data[Date] ), MAX ( Data[Date] ) ),
"month & year", FORMAT ( [Date], "MMM-YYYY" )
),
[month & year]
)

 

 

Hi, My name is Jihwan Kim.

 

If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.

 

Linkedin: linkedin.com/in/jihwankim1975/

Twitter: twitter.com/Jihwan_JHKIM


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

View solution in original post

9 REPLIES 9
Jihwan_Kim
Super User
Super User

Hi, @Anonymous 

I am not sure if I understood your question correctly, but please try something like below.

 

Picture8.png

 

Calendar Table =
SUMMARIZE (
ADDCOLUMNS (
CALENDAR ( MIN ( Data[Date] ), MAX ( Data[Date] ) ),
"month & year", FORMAT ( [Date], "MMM-YYYY" )
),
[month & year]
)

 

 

Hi, My name is Jihwan Kim.

 

If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.

 

Linkedin: linkedin.com/in/jihwankim1975/

Twitter: twitter.com/Jihwan_JHKIM


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.
Anonymous
Not applicable

@Jihwan_Kim hi! juste I got a question what if I want that the result depend on a filter. I got two columns "Name" and "Name2" and I would like to have my column uptaded each time I change the filter. I try to add a Filter() in the dax formula but I didn't succed.

Can you help me please?

Thank you

Hi, @Anonymous 

Sorry, I quite do not understand your question.

Can you share your sample pbix file's link here, together with how the expected result looks like?


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.
Anonymous
Not applicable

@Jihwan_Kim  

https://www.dropbox.com/s/ko46q78pzqemazv/Test%20YEAR.pbix?dl=0

My function Calendar Table will creat all the month and year between my min and max of my Date Production column. Imagine I change the filter and I put only the name "yes", my min and max wouldn't be the same as if there are yes and no in the filter. But with this code if I change or not the filter it doesn't change anything, it will take the min and max of my column without filter. And I would like, it takes the min and max to the column depending on the filter choose.

It is clearer?

Thank you

Hi, @Anonymous 

I think you want to control the actual table by the slicer, right?

I am not sure but I think it is not possible in a normal way.

One way you can achieve this is by creating measures with filter function and calculation function. In this way, I think you can visualize it in the way you want.


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.
Anonymous
Not applicable

ok thank you I will try!

 

Anonymous
Not applicable

Thank you very much

Have a nice day!

amitchandak
Super User
Super User

@Anonymous ,

 

Try like

 

Addcolumns(calendar(Min(Table[Date]), Max(Table[Date]) ), "Month" , month([date]) , "Year", year([date]), "Month Year", format([date],"mmm-yyyy") , "Month year sort", year([date])*100 + month([date]))

 

or

 

Addcolumns(calendar(date(2020,01,01), date(2021,12,31) ), "Month" , month([date]) , "Year", year([date]), "Month Year", format([date],"mmm-yyyy") , "Month year sort", year([date])*100 + month([date]))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Thank you for your answer,

Unfortunately it doesn't work, well it's the good format but I still have a line for each day even if we can see only the month. I think I badly expressed myself but imagine the min date is 01 january 2017 and the max 25 april 2017, I would like to have a list of the following data: january 2017; february 2017; mars 2017; april 2017. Do you think it's possible?

Thank you!

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.