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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
bsz412
Helper III
Helper III

Calendar table strange behavior

Hi, 

 

I have a calendar table created as below: 

Calendar = var FullCalendar = ADDCOLUMNS(CALENDAR(MIN(sales_purchase[Date]),MAX(sales_purchase[Date])),"Month Number",MONTH([Date]),"Year",YEAR([Date]),"Year-Month",LEFT(FORMAT([Date],"yyyyMM"),6),"Year-MonthName",YEAR([Date]) & " " & Format([Date],"MMM"))
return
SUMMARIZE(FullCalendar,[Month Number],[Year],[Year-Month],[Year-MonthName])

 

output is: 

bsz412_0-1646395227256.png

The problem is, if I use the date as hierarchy it show it till end of 2022, all month, even though those months are not in the calendar table

bsz412_1-1646395321631.png

 

bsz412_2-1646395345244.png

I need to have this drill down possibility from year to month, so I would like to understand why is this happening and how can I fix it. I appreciate your thoughts on this. 

8 REPLIES 8
v-luwang-msft
Community Support
Community Support

Hi @bsz412 ,

Has your problem been solved, if so, please consider Accept a correct reply as the solution or share your own solution to help others find it.

Best Regards
Lucien

bsz412
Helper III
Helper III

I have the same issue with a different calendar table as well 😞 I found out that the root of the issue is that the date hierarchy does not react to the date slicer. How could I fix that? @johnt75 @HotChilli 

Try creating a proper date table instead of using the built-in one. You can use the code you have already but get rid of the SUMMARIZE, you want to return the full table. When you've created it, you can right-click on it and choose "Mark as date table". You'll then be able to create your own date hierarchy which should solve your problems

HotChilli
Super User
Super User

I think there's a conflict between the calendar table and the auto-created date table.  There is no Month table in the created table but it appears in the field well for Axis.  Click on the Year-MonthName caret and see if it lets you pick your hierarchy.

johnt75
Super User
Super User

I think Power BI is using an automatically created calendar table, which always has dates covering entire years. If you add the column I suggested you should be able to filter out all the dates after today

unfortunately it doesnt work. I will try to create a new calendar table

johnt75
Super User
Super User

Add another column onto your Calendar table called Today or Before, defined as [Date] <= TODAY(), then you can use that as a filter on the visual to only show when true.

in the calendar table I have data only till Feb 2022. on the chart when i use my date column as hierarchy, it does not react to my period slicer either. Regardless of the period slicer selection X axis always shows date from jan 2021 till dec 2022. Period slicer uses the exact same date column. When I use this date column on X axis without hierarchy, it works, but then I lose the drill down option

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.